Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / June 2007

Tip: Looking for answers? Try searching our database.

Newbie question about master page

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ckerns@refuse.net - 25 Jun 2007 08:12 GMT
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
Eliyahu Goldin - 25 Jun 2007 08:55 GMT
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.

Signature

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 .
[quoted text clipped - 5 lines]
>
> ck
ckerns@refuse.net - 25 Jun 2007 13:22 GMT
I understand this.  But what determines what is the first content page
to be displayed when site is loaded?

>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 - 25 Jun 2007 13:50 GMT
Your app workflow and user navigation determinate the order of page loading.
The point I tried to make that it has nothing to do with master pages..
Perhaps you could elaborate your question more.

Signature

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

>I understand this.  But what determines what is the first content page
> to be displayed when site is loaded?
[quoted text clipped - 3 lines]
>>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.
ckerns@fuse.net - 25 Jun 2007 14:31 GMT
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.

>Your app workflow and user navigation determinate the order of page loading.
>The point I tried to make that it has nothing to do with master pages..
>Perhaps you could elaborate your question more.
Mark Rae - 25 Jun 2007 14:38 GMT
> 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...

Signature

http://www.markrae.net

Eliyahu Goldin - 25 Jun 2007 15:07 GMT
> In default.aspx, simply redirect to the content page you want to display
> first...

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

Signature

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

>> My site has a default.aspx, master.aspx, and six content pages.
>>
[quoted text clipped - 10 lines]
> In default.aspx, simply redirect to the content page you want to display
> first...
Mark Rae - 25 Jun 2007 14:11 GMT
>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...

Signature

http://www.markrae.net

Mark Rae - 25 Jun 2007 08:55 GMT
>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...

Signature

http://www.markrae.net


Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.