how to include like you did in ASP

bri189a

Senior Contributor
Joined
Sep 11, 2003
Messages
1,004
Location
VA
You remember in ASP when you could have part of web page made, like the top menu bar and then in your other ASP pages you would just put an include at the top and then you'd never have to worry about that top menu bar, or whatever again? How the heck to you do that in ASP.NET? I mean I feel like OO has gone out the window when I'm having to put menu buttons at the top of every aspx page that all do the same thing... Home points to index.aspx, News points to news.aspx, etc., etc.... you know? I mean I could do frames do get that, but I don't like frames, though I guess I'll be using them if I don't have a choice.
 
Hi,

You have two choices.

1) If the page you want to include is mostly static content, or you dont use Code Behind files, you can still use the Include File command like in ASP, just simply include a .aspx file.

I use this method in all of my web applications.

2) User a User Control. This is really the *proper* way of doing it, and is usefull if you are providing dynamic content like a content rotator or something else.

I also use User Controls and once you figure out how they work they actually intergrate quite well.

Hope this helps.

Thanks

Andrew
 
Back
Top