PDA

View Full Version : how to include little pages?


Zpixel
09-07-2009, 02:10 PM
I'm making an ASPNET website using c#. it has more than 10 pages for example. i want to put the header part of the HTML code into a separate page, and then to include that page into all the other pages. the header page may need to have some lines of C# or ASP code. How can i do that?

in PHP everything is easy. you simply include('filename') everything into everything.

here in ASPNET,
<!--#include file=layoutheader.aspx --> gives error,
Server.Execute("addProduct.aspx"); causes error.

what should i do?

Mike_O
09-07-2009, 05:22 PM
Hey Zpixel,

Here you go: http://quickstarts.asp.net/QuickStartv20/aspnet/doc/masterpages/default.aspx

Regards,

Mike

Zpixel
09-08-2009, 05:50 AM
master & content pages are a funny concept in aspNet. I finally gave up making my website using common parts for different pages.

ghell
09-08-2009, 06:37 PM
Once you get the hang of them they aren't too bad. Visual Studio makes them a bit easier to use than coding them entirely yourself too. My only problem with them is that you can only have one form on the generated page. This pretty much restricts you to having the form on your master page covering everything and then that needs certain workarounds (that can be found easily on Google).