Examples of building web site navigation for ASP.NET site?

J

Jason Hanks

Hi, are there any examples that demonstrate how to build an ASP.NET page
with consistent parts of the layout, such as page headers, footers, and
navigation links (such as going into each section like Products, Company,
Services, etc)?

I know there are controls that you can use to build menus like ASP.NET menu.
But I'm talking more about the graphical elements and layout that needs to
be part of each page.

For example when I designed my site in old ASP I had include files. So I
did something like this from each page:

<!-- #INCLUDE VIRTUAL="/top-of-page.inc"-->
main page content goes here
<!-- #INCLUDE VIRTUAL="/bottom-of-page.inc"-->

But in ASP.NET that doesn't seem like a concept that works. Instead it
seems like maybe I have a common class or something that will write out my
headers and footers so I have a consistent look and feel, and so I can just
change nav links in one place as I make changes to the site instead of
having to change it on every page like I would if I had embedded it. Any
examples of how to handle this the "correct" or ideal way in ASP.NET would
be MUCH APPRECIATED. Thank you.
 
P

pmb

You can implement a so-called "User Control". It works approximately
like this:

<%@ Register TagPrefix="myctl" TagName="Footer" Src="footer.ascx" %>
.... Later on: ...
<myctl:Footer id="footer1" runat="server" />

Use the keyword "User Control" to find it in the documentation pages.

Good luck!
 
J

Jason Hanks

Are there any samples like in the VB.NET resource kit or somewhere else
somecan can point me to where I can get a good look at how the site
navigation html source can be centralized in one location/class/file?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,054
Latest member
LucyCarper

Latest Threads

Top