Hey,

I come from a PHP & Smarty background, and am looking at ASP master pages... now one thing i used to do with my PHP sites were split out the content into bitesize sections then include them as and when are needed, as shown below:

PHP
Code:
// Some HTML
<div>{{$HeaderContent}}</div>
<div>{{$MainContent}}</div>
<div>{{$FooterContent}}</div>
// Some more HTML
which is pretty much the same as:

ASP
Code:
// Some HTML
<div><asp:ContentPlaceHolder id="Headercontent" runat="server" /></div>
<div><asp:ContentPlaceHolder id="MainContent" runat="server" /></div>
<div><asp:ContentPlaceHolder id="FooterContent" runat="server" /></div>
// Some more HTML
Now that bit seems fine to me, but its when i start adding the behind the scenes logic that im a bit unsure as to how ASP would do this:

PHP
Code:
// Some PHP

$intPage = $_GET["page"];

switch($intPage)
{
    // Some switches
    default: require_once("default_content.php"); break; // This would fill the content section
}

if($intPage > 5)
{ require_once("specific_header.php"); } // This would fill the header with one set of content
else
{ require_once("default_header.php"); } // This would fill the header with a default content

// Some more PHP
Now thats just a VERY rough example of the sort of thing i was doing, but as you can see, although there is one main template, it is filled through multiple sub pages. So you never leave the index.php page, you just stay on there and it drags in other content depending on a page ID.

Now in ASP it always seems to be that you have a MasterPage and then you have another page that you call that gives it content, and it only ever seems to be 1 aspx page to 1 master page, so you would have to go to home.aspx or results.aspx rather than just doing default.aspx?page=1 (home page). So is there a way to do this and have multiple aspx pages called to fill a master page?

Hope that makes sense...