views:

220

answers:

2

I'm creating an ASP.NET web site where all pages hang off a database-driven tree-hierarchy. Pages typically present HTML content. But, some will execute programming.

Examples: (1) a "contact us" form or (2) a report generator

How should I represent/reference the programming within the database? Should I have a varchar value of a Web User Control (.ascx) name? Or a Web Form (.aspx) name? Something else? Or should it just be an integer or other such ID in a dictionary within my application?

Can I make an ASP.NET Site Map Provider with this structure?

See more information here: Which is the best database schema for my navigation?

+1  A: 

Our development team has had success with defining the name of a Web User Control in the database. Upon page load it checks too see what controls to dynamically load from the database.

We use Web User Controls instead of Web Forms in order to ensure we can use the control on any page.

You can also dynamically build a site map using ASP.Net's provider. CodeProject has a good example.

ern
+1  A: 

You might consider inserting placeholders like <my:contact-us-form/> in the database on specific pages; that way the database can describe all the static text content instead of completely replacing that database-driven content with an .ascx control.

John Calsbeek