The views expressed on this weblog are mine alone and do not necessarily reflect the views of my employer, Avanade.

  • Code Complete, Second Edition
    Code Complete, Second Edition
    by Steve McConnell

Code Snippets makes developers more productive

I created this tool to make reusing common functions, queries or other pieces of code easy as pie.

Entries in Microsoft Exam 70-553 (49)


Exam 70-553 - Implement data-bound controls.

 Section 2

  • Part 2
    Integrating Data in a Web Application by Using ADO.NET, XML, and Data-Bound Controls
    • Topic 1


Implement data-bound controls.

  • Use tabular data source controls to return tabular data.
  • Use hierarchical data source controls to display hierarchical data.
  • Display data by using simple data-bound controls.
  • Display data by using composite data-bound controls.
  • Display data by using hierarchical data-bound controls.
  • Use the FormView control to display the values of a single table record from a data source.


Tabular Data Source Controls are meant to connect data ready components to data sources that represent data in tables. Tabular Data Source Controls include:

AccessDataSource - Represents a connection to an access database
DataSetDataSource - Works with the Xml Representation of a Data Source
ObjectDataSource - Allows binding to a custom Object
SqlDataSource - Represents a connection to a SQL server

Hierarchical data source controls are meant to connect data ready components to data sources that represent xml like data where nodes can nest as much as necessary. Hierarchical data source controls include:

SiteMapDataSource - Gets Data from an ASP.Net SiteMap

XmlDataSource - Loads data from an Xml File, Url, or string (Can be used to bind to results of Web Service that supports get through the Url Property)

The List of Data Controls comes from the ASP.Net 2.0 Quickstart link in the resources.

GridView - Renders data in a grid format. This control is an evolution of the DataGrid control, and can automatically take advantage of data source capabilities.

DetailsView - Renders a single data item in a table of label/value pairs, similar to the form view in Microsoft™ Access. This control can also automatically take advantage of data source capabilities.

FormView - Renders a single data item at a time in a form defined by a custom template. Renders a single data item in a table of label/value pairs, similar to the form view in Microsoft™ Access. This control can also automatically take advantage of data source capabilities.

TreeView - Renders data in a hierarchical tree view of expandable nodes.

Menu - Renders data in a hierarchical dynamic menu (including flyouts).

The FormView supports automatic Updates, Inserts, and Deletes through its associated data source control just like the DetailsView control. To define the input UI for editing or inserting, you define an EditItemTemplate or InsertItemTemplate in addition to the ItemTemplate. In this template you will data bind input controls such as TextBox, CheckBox, or DropDownList to the fields of the data source. Data bindings in these templates use a "two-way" data binding syntax, however, to allow the FormView to extract the values of input controls from the template in order to pass to the data source. These data bindings use the new Bind(fieldname) syntax instead of Eval.

Other Resources & Links:

More Load, Less Code with the Data Enhancements of ASP.NET 2.0

Data Source Controls in ASP.Net 2.0

Data Controls (ASP.Net 2.0 Quickstart)


Exam 70-553 - Program a Web application.

Section 2

  • Part 1
    • Topic 3

Program a Web application.

  • Redirect users to another Web page by using a server-side method.
  • Detect browser types in Web Forms.
  • Ascertain the cause of an unhandled exception at the page level.
  • Programmatically access the header of a Web page.
  • Implement cross-page postbacks.
  • Assign focus to a control on a page when the page is displayed.
  • Avoid performing unnecessary processing on a round trip by using a page's IsPostBack property.
  • Access encapsulated page and application context.
  • Avoid unnecessary client-side redirection by using the HttpServerUtility.Transfer method.
  • Avoid round trips by using client-side scripts.
  • Use a page's Async attribute to create a page that has built-in asynchronous capabilities.
  • Convert HTML server controls to HTML elements.


Redirecting users to other pages through Server Side Methods is accomplished through Response.Redirect, HttpServerUtility.Transfer and Server.Transfer.

The Request object now exposes a Browser Object which can be used to determine the Browser type and capabilities.

At the page level you can subscribe to the Page OnError event which will allow you to get the last error by using Server.GetLastError to get the last exception that occurred.

You can access the header of a web page through the HTMLHead Control as long as you make the Head tag have the RunAt=Server Attribute. You can use it to modify the title, links, scripts, etc.

To Implement Cross Page Postbacks in ASP.Net 2.0 by setting the PostBackUrl property of the button control to the page you want your web form to post to. In the Posted Page you can access the calling page through the PreviousPage property which would be null if it wasn’t a cross page postback. The one tricky situation that could occur is that Validation on the Server side will not occur unless you call the PreviousPage.IsValid method to make sure that the post passed validation.

There are three ways to set focus programmatically using ASP.Net 2.0. You can use the Page.SetFocus Method with the ControlID of the Control you want to set the focus on, You can call the Focus method of the control itself, or you can set the DefaultFocus property of the Form element.

The IsPostBack Property lets you know programmatically if the page was posted back and you can avoid refreshing data that was persisted to Viewstate.

The HttpServerUtility.Transfer method works like the Response.Redirect method but without the extra client side trip.

In ASP.Net you can now set a PageDirective Attribute of Async to true to use the IHttpAsyncHandler. You then can use the AddOnPreRenderComplete method to set a method to be called on the Begin and End of the PreRender event.

You can convert HTML Server controls to html elements by unchecking the runat server property or removing the runtat=”server” attribute from the control in html view.

Other Resources & Links:

Design Considerations for Cross Page Post Backs in ASP.NET 2.0

How to: Detect Browser Types in ASP.NET Web Pages

Web Application Error Handling in ASP.Net

HTMLHead Class

Focus in ASP.Net Controls

HttpServerUtility.Transfer Method

Wicked Code: Asynchronous Pages in ASP.Net 2.0

How to: Convert HTML Server Controls to HTML Elements


Exam 70-553 - Configure settings for a Web application.

Section 2

  • Part 1
    • Topic 2

Configure settings for a Web application.

  • Configure system-wide settings in the Machine.config file.
  • Configure settings for a Web application in the Web.config file.
  • Manage a Web application's configuration by using the Web Site Administration Tool.


As was the case in previous versions of ASP.Net, there are many settings that can be defined in both Machine.config and Applications Web.Config. With ASP.Net there are many more settings that can be controlled in both files. Lucky for us, in ASP.Net we also have access to a Web Site Administration tool and mmc tools to make it easier to make changes using a GUI interface that will modify the Xml stored in the configuration files without having to manually modify them.

At the very least be familiar with the Web Site Administration Tool which can be accessed by navigating to webadmin.axd under your applications root. The tool has four tabs: Security, Profile Application and provider. Most of these are discussed in detail in other posts on this site

Other Resources & Links:

Configuration Management in ASP.Net 2.0

Configuration Management in ASP.Net 2.0 Part 2


Exam 70-553 - Add and configure Web server controls.

Most of this post was written by Juan Suero, another developer who works for Avanade. Check his blog, Meta Dojo to see some of the other interesting things he has to say.

This is the first post of Section 2 of the subject material that Exam 70-553 covers. This topic has more links than any other section in the guide. Feel free to add more to this or any other section by posting comments.

Section 2

  • Part 1

    Creating and Programming a Web Application

    • Topic 1

Add and configure Web server controls.

  • Add Web server controls to a Web Form.
  • Configure the properties of Web server controls programmatically.
  • Configure Web server control properties by using the Microsoft Visual Studio Property Editor.
  • Specify whether events of a control cause a Web Form to post to the server.
  • Configure a control to receive postback events.
  • Access controls in Web Forms pages when working with naming containers and child controls.
  • Create HTML server controls in the designer.
  • Set HTML server control properties programmatically.
  • Use HTML server controls to programmatically access HTML tags.
  • Create HTML controls as elements in an HTML document.
  • Use the AdRotator Web server control to manage banners and pop-up windows.
  • Use the Button Web server control to send a command to the server when a button is clicked.
  • Display a calendar on a Web page by using the Calendar Web server control.
  • Implement the CheckBox Web server control.
  • Implement the FileUpload Web server control.
  • Create and manipulate links on a Web Form by using the HyperLink Web server control.
  • Display an image on a Web Form by using the Image Web server control.
  • Implement a button on a Web Form by using the ImageButton Web server control.
  • Define hotspot regions within an image by using the ImageMap Web server control.
  • Use the Label Web server control to display customized text on a Web page.
  • Display a hyperlink style button on a Web Form by using the LinkButton Web server control.
  • Display lists of information by using controls that derive from the ListControl class.
  • Create a Web Form with static text by using the Literal Web server control.
  • Implement pagination for controls on a page by using the Pager Web server control.
  • Use the Panel Web server control to arrange controls in groups on a page.
  • Create a container for a group of View controls by using the MultiView Web server control.
  • Use the View Web server control to create a Web application.
  • Create a mutually exclusive set of choices by using the RadioButton Web server control.
  • Construct a table by using the Table, TableRow, and TableCell Web server controls.
  • Enable users to type information into a Web Form by using the TextBox Web server control.
  • Create a wizard by using the Wizard Web server control to collect data through multiple steps of a process.
  • Use the XML Web server control to create XML data at the location of the control.
  • Customize the appearance of Web server controls by using Web control templates.
  • Programmatically edit settings in a Web site's configuration file.
  • Dynamically add Web server controls to a Web Forms page.


This section covers some of the basics of ASP.Net which you should be familiar with already if you are taking this test. But there are many new controls introduced in ASP.Net 2.0

With the exception of some specialist controls, such as the Web Parts controls, all the server controls are implemented in 2 namespaces: system.web.ui.htmlcontrols and system.web.ui.webcontrols, as in v1.X.

Controls New to ASP.Net 2.0 include:

  • DynamicImage automatically translates an image into the correct format
  • ImageMap (self explanatory)
  • Multiview and View allow developers to create different blocks of UI and insert into the page at runtime
  • Wizard provides multi page wizard type interfaces
  • Web parts Controls (discussed in other sections)

The following details and example of using the Wizard Control is from MSDN2:

With the Wizard control, you use discrete steps to collect data, which allows users to navigate between steps at their discretion and creates a simpler user experience. As a developer, you do not have to worry about making your data persist across pages because the control maintains state while the user completes the various steps.

The Wizard control uses steps to delineate different sections of user data input. Each step within the control is given a StepType to indicate whether it is the beginning step, intermediate step, or completion step. The wizard can have as many intermediate steps as needed. You can add different controls, such as a TextBox or ListBox control, to collect user input. When you reach the Complete step, all of your data is accessible. The following code example illustrates the Wizard control with two steps.

<asp:Wizard ID="Wizard1" Runat="server">
<asp:WizardStep Runat="server" Title="Step 1">
<asp:WizardStep Runat="server" Title="Step 2">
</asp:Wizard> <asp:Wizard ID="Wizard1" Runat="server"
StepNextButtonText=" Next >> "
StepPreviousButtonText=" << Previous "
FinishCompleteButtonText=" Done! ">

You can customize the behavior of the Wizard control by using custom code and events.

For example, you can intercept the NextButtonClick event, which is raised when the user clicks the Next button and captures the data of the current step. The WizardNavigationEventArgs parameter passed to this event includes the CurrentStepIndex and NextStepIndex properties, enabling you to customize the behavior of the control based on the current and next steps, or to cancel the navigation when the Next button is clicked.

Similarly, you can customize the behavior of the Previous and Finish buttons by using the PreviousButtonClick and FinishButtonClick events. Or you can perform cleanup when the Cancel button is clicked by using the CancelButtonClick event.

  • Login presents the user with the customary username and password textboxes
  • LoginName displays the name of the currently authenticated user
  • LoginStatus displays the login status!
  • LoginView provides 2 templates in which the UI for a section of the page is specified and the appropriate content displayed depending on the authentication status of the current user
  • PasswordRecovery displays a 3-step wizard so the user can have their forgotten password sent to them
  • TreeView generates a collapsible tree view
  • SiteMapDataSource exposes hierarchical XML data in a suitable format for databinding to navigation controls such as the TreeView
  • SiteMapPath displays the hierarchical path through the sites page hierarchy to the current page
  • PostBackURL: used with the Button controls to force the page to be posted to a different
  • SqlDataSource and AccessDataSource
  • ObjectDataSource provides access to data exposed through a strongly typed data layer, thus supporting n-tier techniques
  • XmlDataSource for databinding to control that can display such hierarchical data
  • DataSetDataSource for 'flat' XML documents
  • GridView, DetailsView and FormView are databound controls like the DataGrid of v1.X.
  • ContentPager helps divide pages into separate sections for small screen devices
  • PhoneLink can be used to initiate a phone call
  • programmatic access to the following

o HtmlHead, HtmlTitle and HtmlLink controls.

o HtmlInputPassword, HtmlInputReset and HtmlInputSubmit controls

o BulletedList (<ul> and <ol>)

o FileUpload (<input type="file">

o HiddenField (<input type="hidden">

  • The DynamicImage control
  • The MultiView and View Controls

Look through the resources for details on any of the topics listed in this section.

Other Resources & Links:

The New ASP.NET 2.0 Controls

Creating Custom Web Controls with ASP.NET 2.0

ASP.NET 2.0 Internals

To add a control using ASP.NET syntax

Adding Controls to a Web Forms Page Programmatically

Setting Web Server Control Properties Programmatically

Properties Window

Determining the Control that Caused a PostBack

Postback Event Sample

In Search Of ASP.Net Controls

INamingContainer Interface .NET Framework Class Library

Positioning HTML Elements in Design View

Setting HTML Server Control Properties Programmatically

Converting HTML Server Controls to HTML Elements

Choosing between server and client controls

AdRotator Class .NET Framework Class Library

ASP.NET AdRotator - Basic and Extending

Button Class .NET Framework Class Library

Calendar Class .NET Framework Class Library

CheckBox Class .NET Framework Class Library

ASP.NET 2.0 FileUpload Control

FileUpload Class .NET Framework Class Library

HyperLink Class .NET Framework Class Library

Image Class .NET Framework Class Library

ImageButton Class .NET Framework Class Library

Creating a Menu User Control (With Rollovers)

Image Maps in ASP.NET 2.0

ImageMap Class .NET Framework Class Library

Label Class .NET Framework Class Library

AssociatedControlID in ASP.NET 2.0

LinkButton Class .NET Framework Class Library

Very useful OnClientClick property for developers (in 2.0)

ListControl Class.NET Framework Class Library

A Crash Course on ASP.NET Control Development: Building Data-Bound Controls

Literal Class .NET Framework Class Library

Paging in a GridView Web Server Control

Paging in a DetailsView Web Server Control

Paging in a FormView Web Server Control

Panel Class .NET Framework Class Library

ASP.NET 2.0 MultiView Control

MultiView Class .NET Framework Class Library

View Class .NET Framework Class Library

RadioButton Class .NET Framework Class Library

RadioButtonList Class .NET Framework Class Library

Table Class .NET Framework Class Library

Adding Rows and Cells to a Table Web Server Control

Textbox Web Server Control

A MaxLength compliant Multiline Textbox Control in ASP.NET 2.0

The ASP.NET 2.0 Wizard Control

Working with the Wizard Control Using Visual Studio 2005

Xml Web Server Control

MSDN: XML Web Server Control

ASP.NET Web Server Controls Templates

How to: Create Web Server Control Templates Using the Designer

How to: Create ASP.NET Web Control Templates Declaratively

How To: Create ASP.NET Web Server Control Templates Dynamically

Configuration Management in ASP.NET 2.0 - Part 2

The Configuration API in .NET 2.0

Configuration Members: NET Framework Class Library

Dynamic Web Controls, Postbacks, and View State

Dynamically Adding Controls to a Web Page...


Reflections on having taken BETA Exam 71-553

The format for Exam 71-533 was different than other Microsoft Exams I has taken in the past. It included 89 total questions broken into groups of 30, 29 and 30. Each Group corresponded to a Section in the list of topics the exam was supposed to cover. And once you finished a section you couldn't go back. Most of the exam focused on just the new features of .Net 2.0

The first section focused on Web Development.

No big surprises if you studied the topics. Questions on Web Parts, Master Pages, Themes, ADO.Net centric questions, SiteMap and TreeView, User Controls, the new Wizard Control, Tracing, The new membership provider model.

The second section focused on Windows Development

It covered a lot of Xml Centric questions, validating a schema, More ADO.Net stuff, MultiThreading with the Background Worker Process, transactions, BulkCopy, Database Factory, Deploying with Click Once, Code Access Security.

The third section was more framework stuff.

It covered Crypto, Generics, Enumerators, Queues, Serialization, DriveInfo, Compressing with GZip and Deflate, Security stuff.

Page 1 ... 4 5 6 7 8 ... 10 Next 5 Entries »