Newbie question about master page

  • Thread starter Thread starter ckerns
  • Start date Start date
C

ckerns

I am building my first site with a master page (first time using
VS2005) and several content pages and I have a dumb question .

What determines which content page is displayed when the page first
loads? How do I set this?

tia

ck
 
In run time a master page doesn't have any separate existence. It is just a
part of another page, similar to a user control. So you don't display a
master page. You display a page that includes the master page.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
 
I am building my first site with a master page (first time using
VS2005) and several content pages and I have a dumb question .

What determines which content page is displayed when the page first
loads? How do I set this?

The biggest misconception about MasterPages is that they are somehow the
ASP.NET equivalent of framesets - they aren't at all.

In fact, a MasterPage is nothing more than a UserControl.

The MasterPage doesn't control which content page to display - it's the
other way round.

In order to display a content page, you navigate to it just like you would a
normal page e.g. Response.Redirect("MyContentPage.aspx") - the content page
knows which MasterPage to use, and constructs itself accordingly...
 
I understand this. But what determines what is the first content page
to be displayed when site is loaded?
 
I understand this. But what determines what is the first content page
to be displayed when site is loaded?

Whatever page you have designated as your site's startup page. Typically,
this would be default.aspx in the root of the virtual directory, but it
doesn't have to be...

If your startup page is a content page, then it will load its associated
MasterPage.

As Eliyahu says, this has nothing to do with content pages / MasterPages per
se...
 
My site has a default.aspx, master.aspx, and six content pages.

When the site loads, it loads the default page which in turns fires
the master page. What determines which content page is displayed
first.
 
My site has a default.aspx, master.aspx, and six content pages.

When the site loads, it loads the default page which in turns fires
the master page. What determines which content page is displayed
first.

See my earlier reply...

default.aspx is one of the standard startup pages on IIS sites so, unless
you've modified this, this will almost certainly be your site's startup
page.

In default.aspx, simply redirect to the content page you want to display
first...
 
In default.aspx, simply redirect to the content page you want to display

Just to make it clear. The whole discussion was around this point. Open a
content page, not the master one.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net


Mark Rae said:
My site has a default.aspx, master.aspx, and six content pages.

When the site loads, it loads the default page which in turns fires
the master page. What determines which content page is displayed
first.

See my earlier reply...

default.aspx is one of the standard startup pages on IIS sites so, unless
you've modified this, this will almost certainly be your site's startup
page.

In default.aspx, simply redirect to the content page you want to display
first...
[/QUOTE]
 
Back
Top