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

12.5. Practical Tips for Displaying and Updating Data

The following list provides some practical tips for displaying and updating data.

  • Always store your connection strings in the web.config file. Although it may seem easy to store them directly in the SqlDataSource in a page, you'll get in trouble when you need to make changes to your connection string later.

  • Always consider adding validation controls to your data entry pages. It makes it a lot easier for your users to find out what data is required, and in what format they should deliver it, while you protect your system from receiving and processing invalid or incorrect data.

  • If you have long lists of data to present, always consider turning paging on for controls like the GridView. Users tend to get lost if you present them with lists of over 50 items. Generally, a page size of somewhere between 10 and 20 items is best.

  • Consider renaming the controls in the page to something other than their default values. For example, in the previous Try It Out exercise you renamed SqlDataSource2 to sdsGenres. This makes it much easier to see which data source is needed to get information about the genres. With only a few controls in a page this isn't really an issue, but as soon as your page grows, it is increasingly important to choose distinguishing names for your controls.

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