Skip to Content
Beginning ASP.NET 3.5: In C# and VB
book

Beginning ASP.NET 3.5: In C# and VB

by Imar Spaanjaars
March 2008
Intermediate to advanced content levelIntermediate to advanced
766 pages
21h 15m
English
Wrox
Content preview from Beginning ASP.NET 3.5: In C# and VB

A.12. Chapter 12

A.12.1.

A.12.1.1.
A.12.1.1.1. Exercise 1 solution

The best control for this scenario is GridView. It's easy to set up and has built-in support for paging, updating, and deleting of data. Together with a DetailsView control you can offer your users all four CRUD operations. In addition, you need a SqlDataSource control to get the data from the database and display it in the GridView or DetailsView.

A.12.1.1.2. Exercise 2 solution

For a simple, unordered list, you're probably best off using a Repeater control. The biggest benefit of the Repeater control is that it emits no HTML code on its own, allowing you to control the final markup. A downside of the control is that it doesn't support editing or deletion of data, which isn't a problem if all you need to do is present the data in a list. Chapter 13 shows you how to use the Repeater control.

A.12.1.1.3. Exercise 3 solution

A BoundField is directly tied to a column in your data source and offers only limited ways to customize its appearance. The TemplateField, on the other hand, gives you full control over the way the field is rendered. As such, it's an ideal field for more complex scenarios — for example, when you want to add validation controls to the page, or if you want to let the user work with a different control, like a DropDownList instead of the default TextBox.

A.12.1.1.4. Exercise 4 solution

You should always store your connection strings in the web.config file. This file has an element called ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Beginning ASP.NET 4: in C# and VB

Beginning ASP.NET 4: in C# and VB

Imar Spaanjaars
Professional ASP.NET 3.5 SP1 Edition: In C# and VB

Professional ASP.NET 3.5 SP1 Edition: In C# and VB

Bill Evjen, Scott Hanselman, Devin Rader

Publisher Resources

ISBN: 9780470187593Purchase book