Wiley 978-0-7645-9766-4 Datasheet

Browse online or download Datasheet for Software manuals Wiley 978-0-7645-9766-4. Wiley ASP.NET 2.0 MVP Hacks and Tips User Manual

  • Download
  • Add to my manuals
  • Print
  • Page
    / 24
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 0
Hacks Revisited
Hacks exist in an ever-changing world. One day they are the cutting-edge, clever inventions of a
developer with a need. Another day in the future, they can become mainstream code or practices
that are integrated into a product or process. The mark of a successful hack is that one day it will
become the norm.
This chapter is all about hacks that have become successful. We revisit ASP.NET v1.1 to look at a
group of hacks that received much attention. They became so useful that Microsoft felt compelled
to add support for them in ASP.NET v2.0. Rather than redo hacks that have already been invented,
this chapter highlights the pioneers and their work that influenced Microsoft to add support in
ASP.NET v2.0. For those of you making the move to ASP.NET 2.0, you’ll learn how these hacks
have been integrated into the .NET Framework and related Visual Studio 2005 support. Seeing
how previous hacks have positively influenced the current version of ASP.NET can give you and
others a greater appreciation for hacks, and provide motivation for new hacks that will have a pos-
itive influence on future versions of ASP.NET.
Wizards Hacks Replaced by ASP.NET 2.0
Wizards are user interface tools for gently guiding users through a process. This discussion refers to
wizards that you add to your applications. Developers have used them for many years, from instal-
lation programs to simplifying complex activities through a series of steps. They’ve traditionally
been a normal part of client desktop applications, but have surfaced as hacks in Web applications.
ASP.NET Wizard Pioneers
An early ASP.NET v1.1, a wizard hack by John Peterson was published as a sample on ASP101.com
(
asp101.com/samples/wizard_aspx.asp)titled “ASP.NET version of Wizard (Multi-Page Form).”
This was an update from a previous implementation for classic ASP 3.0. After support for ASP.NET
2.0 wizards was announced, Tom Blanchard wrote the article “CodeSnip: Simulating the ASP.NET 2.0
Wizard Control with ASP.NET 1.x.” at
123aspx.com/redir.aspx?res=32798. Another pre-existing
04_597663 ch01.qxp 4/25/06 9:54 PM Page 1
COPYRIGHTED MATERIAL
Page view 0
1 2 3 4 5 6 ... 23 24

Summary of Contents

Page 1 - COPYRIGHTED MATERIAL

Hacks RevisitedHacks exist in an ever-changing world. One day they are the cutting-edge, clever inventions of adeveloper with a need. Another day in t

Page 2 - Wizards in ASP.NET v2.0

In Listing 1-3, we’re primarily interested in whether the eating preference was Meat Eater or Vegetarianso we can extract values from the proper contr

Page 3

To get started, create a new Web project and delete the Default.aspx page that is automatically created.We’ll re-create Default.aspx later as a conten

Page 4

Figure 1-10After creating and modifying the Company.master Master Page, you can view the automatically gener-ated HTML code by clicking the HTML butto

Page 5

<form id=”form1” runat=”server”><div><table border=”0” cellpadding=”0” cellspacing=”0” style=”width: 100%; height: 100%”><tr>&

Page 6

Listing 1-5 (continued)ContentPlaceHolderID=”ContentPlaceHolder1” Runat=”Server”><h2>This is my content.</h2></asp:Content>The tw

Page 7

No matter how query string parameters are presented, average users will have a hard time understanding.Instead, it would be much clearer to write the

Page 8

Listing 1-6 (continued)<head runat=”server”><title>.NET Article Archive</title></head><body><form id=”form1” runat=”s

Page 9

<asp:HyperLink ID=”hypMay” runat=”server” NavigateUrl=”~/YEAR/05”>May</asp:HyperLink><br /><asp:HyperLink ID=”hypJune”

Page 10 - Master Pages: Then and Now

Listing 1-8 (continued)SetMonths();}/// <summary>/// configure months to refer to proper page/// </summary>private void SetMonths(){foreac

Page 11 - Hacks Revisited

<add url=”~/2006/01” mappedUrl=”~/MonthView.aspx?year=2006&amp;month=01”/><add url=”~/2006/02” mappedUrl=”~/MonthView.aspx?year=2006&

Page 12 - Chapter 1

solution that some people used was the Wizard Navigator in the User Interface Process (UIP) ApplicationBlock, created by the Microsoft Patterns and Pr

Page 13

Listing 1-10 (continued)</Columns></asp:GridView><asp:ObjectDataSource ID=”ArticlesODS” runat=”server” SelectMethod=”GetArticles” TypeN

Page 14 - URL Rewriting

using System.Data;using System.Web;/// <summary>/// Summary description for ArticleData/// </summary>public class ArticleData{public void

Page 15 - The ASP.NET v2.0 Replacement

Listing 1-13 (continued)<year>2005</year><month>02</month><title>Title2</title><content>This is the text of

Page 16

private string m_year;public string Year{get { return m_year; }set { m_year = value; }}private string m_month;public string Month{get { return m_month

Page 17

Using the ASP.NET v2.0 URL Mapping feature appears to be a great capability, but there is one catch:You can’t use regular expressions. The articles ex

Page 18

Figure 1-2Figure 1-33Hacks Revisited04_597663 ch01.qxp 4/25/06 9:54 PM Page 3

Page 19

5. Select View➪Properties Window to show the Properties window. In the Properties window, setthe HeaderText property to Menu Selector.6. Enlarge the W

Page 20

Figure 1-514. Select the new Step 3 link that you just added to the Wizard control.15. Type Please Select Main Course: in the edit area.16. Drag and d

Page 21

Figure 1-6Figure 1-76Chapter 104_597663 ch01.qxp 4/25/06 9:54 PM Page 6

Page 22

This creates HTML with a Wizard that contains multiple steps. Listing 1-1 shows the HTML of this pagewith modifications made in the later parts of thi

Page 23

Listing 1-1 (continued)Please select beverage:<br /><br /><asp:RadioButtonList ID=”RadioButtonList4” runat=”server”><asp:ListItem

Page 24 - Wrapping Up

Listing 1-2: Altering the sequential progress of a wizardprotected void Wizard1_NextButtonClick(object sender, WizardNavigationEventArgs e){if (Wizard

Comments to this Manuals

No comments