I have a big block of code that I am using as a navigation bar for my site. I am constantly changing it though. Is there some way to save it all in one file and then include it in each page so that I don't have to change it multiple times every time I want to edit it? I am building it using ASP.net on VWD 2005 Beta 2.
I think the main issue will be that if you want the navigation bar to be dynamic then you will want to use a server control otherwise it may be more simple to just create a User Control.
To learn how to create and include a User Control in a page go here:
Yes, User Control is the way to go. Simpler to create than Server Control. Think of them as "smart include files" (if you are familiar with classic ASP server side includes).
For instance, on http://www.geewebtools.com, the top nav is a User Control complete with encapsulated javascript to handle the rollovers.
Goto http://www.geewebtools.com/web-content-management/ - the nav buttons "overview"..."demo" are done with one user control object with different attributes set in the html tag declaration for each of our 25 modules to determine its behavior.
Once you start with User Controls in .NET, you will love them.
Bookmarks