Do more with your ASP.NET Page Template
page 6 of 9
by Sajid Rehman
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 30765/ 112

How do I do it? Database connectivity

Database connectivity & utility classes can be provided in your Page Template by having them set as properties. They are then accessible to your code-behind classes. Initialization of these properties can be done in the OnLoad(). Alternatively, you can provide methods to initialize them in your Page Template class. These methods can then be called from the code-behind.

Advantages

  • Ensures that all developers in the team use features like connection strings, utility classes, loggers, data access objects consistently.
  • Initialization of these utility classes can also be done in the template providing lesser room for inconsistency.
  • Since all developers have to access the utility classes via the template, it ensures that integration headaches are minimized.
  • Ensures that there can be no goof ups arising out of mismatches or incorrect connection strings, log file names, email ids, etc.

View Entire Article

User Comments

No comments posted yet.

Product Spotlight
Product Spotlight 





Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2021 ASPAlliance.com  |  Page Processed at 2021-03-05 1:27:58 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search