Technical Training
ASP.NET 2.0Table of Contents
ASP.NET DataBound Controls - Details View
ASP.NET DataBound Controls - Details View - Page 2
ASP.NET DataBound Controls - Details View - Page 3ASP.NET DataBound Controls - Details View
ASP.NET : DataBound Controls - Details View
In this tutorial you will learn DetailView DataBound Control, To create a file system Web site, Connecting to SQL Server, Use a Drop-Down List as the Master and To test the drop-down list.
The DetailsView is a control that is complementary to the GridView control. It has been introduced in ASP.NET 2.0 to provide an ability to work with a single record or row from an associated data source. The default view of this control is vertical with each column of the record displayed on a line of its own. It is used for updating and inserting new records and used often in the Master-details scenario where the details of the record selected in the master is displayed in detail.
The DetailsView, like the GridView rides on the data source capabilities to update, insert or delete rows. It renders a single data item at a time even when the data source exposes more items. If the data object represents the ICollection interface or the underlying data source exposes the paging operation, the DetailsView can page over the data, provided the AllowPaging property is set to true. Users can also navigate between rows of data using this control.
The process of binding the DetailsView control to a data source is very simple. The DataSourceID property can be set declaratively or programmatically.
The AutoGenerateEditButton property, if set to True, enables editing operations and the DetailsView renders the edit button in addition to the other columns in the control. The Edit mode can be invoked pressing this button. The Edit user interface can be customized using Styles, DataControlField objects and templates.
The DetailsView control can be configured to display a Delete and insert button also. The AutoGenerateInsertButton, when set to true, generates a New button. The new button invokes the insert mode and appropriate user interfaces are rendered including the fields in the DataKeyNames collection. Using this collection the data source control can locate the unique row to be updated.
The DetailsView control user interface can be customized using Style properties such as HeaderRowStyle, RowStyle, AlternatingRowStyle and so on. Templates also can be used to customize this control. EmptyDataTemplate, HeaderTemplate, FooterTemplate and PagerTemplate are some of the templates available for this control.
A number of events can be used to customize the code including pre and post insert, update and delete data source events. This includes ItemCreated and ItemCommand events. There is no selected event in the DetailsView control as the current event is treated as the selected event.
The Control can also be used for rendering mobile devices.
Let us explore the potential of using DetailsView control by creating and executing a page that has such a control on it.
To create a file system Web site
1. Open Visual Web Developer.
2. On the File menu, click New Web Site.
3. The New Web Site dialog box appears.
4. Under Visual Studio installed templates, click ASP.NET Web Site.
5. In the Location box, enter the name of the folder where you want to keep the pages of your Web site.
6. In the Language list, select C#.
7. Click OK.
8. Visual Web Developer creates the folder and a new page named Default.aspx.
Connecting to SQL Server
1. In Server Explorer (Database Explorer), right-click Data Connections and choose Add Connection.
2. The Connection Properties dialog box is displayed:
3. Do the following:
.......a. Enter or select the name of the SQL Server

.......bb. Click Browse and select ExForSys as the database.
4. Click Test Connection, and if it works, click OK.
5. When finished, click OK.
6. The connection is added to Server Explorer.
Using a Drop-Down List as the Master
1. Switch to or open the Default.aspx page.
2. Switch to Design view.
3. Type Select Course by CourseId in the page and format the text as a heading.
4. From the Standard group in the Toolbox, drag a DropDownList control onto the page.
5. In the smart tag panel, select the Enable AutoPostBack check box.
ASP.NET 2.0
- Getting started with ASP.NET 2.0
- .NET Framework Fundamentals
- Microsoft.NET Framework Tools
- Application Development in .NET
- What's New in the .NET Framework 2.0 ?
- Introduction to Visual Studio.NET
- Installing Visual Studio.NET 2005
- Working with Visual Studio.NET Web Applications
- Whats New in ASP.NET 2.0
- Creating an ASP.NET Application
- ASP.NET Code Directory
- ASP.NET Page Object Model
- ASP.NET Server Controls
- ASP.NET Working With Master Pages
- ASP.NET Creating Content for Master Page
- ASP.NET Referencing Master Page Members
- ASP.NET Changing Master Pages Dynamically
- ASP.NET Creating Nested Master Pages
- ASP.NET Working with Web Parts
- ASP.NET Using Web Parts and Controls in Web Pages
- ASP.NET Web Pages and Layout
- ASP.NET - Adding Web Parts at Run Time
- ASP.NET Personalization: User Profiles and Themes
- ASP.NET Data Access features
- ASP.NET State Management
- ASP.NET Customizing the Session State Mechanism
- ASP.NET State Management And Caching
- ASP.NET Security
- Forms Authentication in ASP.NET
- ASP.NET Managing Membership and Roles
- ASP.NET Configuring Page-Level Caching
- ASP.NET Setting Application-Level Caching
- ASP.NET Data Source Object Model
- ASP.NET SqlDataSource Control
- ASP.NET Data Bound Controls
- ASP.NET GridView Control
- ASP.NET GridView Filtering
- ASP.NET Adding Sorting and Paging in GridView
- ASP.NET DataBound Controls - Details View
- ASP.NET Using a Grid to Display Detail Information
- ASP.NET Displaying Master-Detail Data on the Same Page
- Displaying Master-Detail Data on Separate Pages in ASP.NET
- ASP.NET Creating Web Wizards
- ASP.NET : Dynamic Image control
- ASP.NET Advanced Site Functionality







