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 / April 2008

Tip: Looking for answers? Try searching our database.

Master Page Properties persist?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Seth Williams - 24 Apr 2008 16:17 GMT
If I have some Master Page properties, and assign them when the master page
first loads, knowing that I can access these property values in the current
Content pages, will these properties be persisted through every page, until
the browser is closed?
Madhur - 24 Apr 2008 17:12 GMT
It depends where you emit the code for assigning these properties.
Different results for content page, master page.

--
Madhur

> If I have some Master Page properties, and assign them when the master
> page first loads, knowing that I can access these property values in the
> current Content pages, will these properties be persisted through every
> page, until the browser is closed?
Seth Williams - 24 Apr 2008 17:50 GMT
It seems like each page load fires the page load event (non-postback) of the
Master Page

What I'm running into is that when I click a button on one page (which has
the properties loaded), I load a couple of sessions, and then
response.redirect to a second page.

In that second page's load event, I access one of the properties, but it is
'Nothing'. On further testing, apparently, the Page_Load of the content page
is actually firing BEFORE the Page_load event of the Master Page. So the
properties in the Master Page are not accessible to the content page

Once everything's loaded, I can access the properties at any time - no
problem

However, I need to access the Master Page's properties when the content page
is loaded

Is this possible, or am I missing something?

> It depends where you emit the code for assigning these properties.
> Different results for content page, master page.
[quoted text clipped - 6 lines]
>> current Content pages, will these properties be persisted through every
>> page, until the browser is closed?
clintonG - 24 Apr 2008 22:18 GMT
// Reference properties from a previous page.
cross-page postback overview site:msdn2.microsoft.com

> It seems like each page load fires the page load event (non-postback) of
> the Master Page
[quoted text clipped - 26 lines]
>>> current Content pages, will these properties be persisted through every
>>> page, until the browser is closed?
Cowboy (Gregory A. Beamer) - 24 Apr 2008 20:37 GMT
In general, no.

The master page, while it seems like a common container in the designer, is
actually a type of user control, which means it has page scope. Even if all
of your pages use the same master, the properties are not global.

Signature

Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://gregorybeamer.spaces.live.com/lists/feed.rss

or just read it:
http://gregorybeamer.spaces.live.com/

*************************************************

| Think outside the box!

*************************************************
> If I have some Master Page properties, and assign them when the master
> page first loads, knowing that I can access these property values in the
> current Content pages, will these properties be persisted through every
> page, until the browser is closed?

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.