473,471 Members | 1,716 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Master Page Properties persist?

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?
Jun 27 '08 #1
4 1429
It depends where you emit the code for assigning these properties.
Different results for content page, master page.

--
Madhur

"Seth Williams" <sm@here.comwrote in message
news:ev**************@TK2MSFTNGP04.phx.gbl...
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?

Jun 27 '08 #2
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?

"Madhur" <sd*@df.comwrote in message
news:80**********************************@microsof t.com...
It depends where you emit the code for assigning these properties.
Different results for content page, master page.

--
Madhur

"Seth Williams" <sm@here.comwrote in message
news:ev**************@TK2MSFTNGP04.phx.gbl...
>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?


Jun 27 '08 #3
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.

--
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!
|
*************************************************
"Seth Williams" <sm@here.comwrote in message
news:ev**************@TK2MSFTNGP04.phx.gbl...
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?


Jun 27 '08 #4
// Reference properties from a previous page.
cross-page postback overview site:msdn2.microsoft.com

"Seth Williams" <sm@here.comwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
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?

"Madhur" <sd*@df.comwrote in message
news:80**********************************@microsof t.com...
>It depends where you emit the code for assigning these properties.
Different results for content page, master page.

--
Madhur

"Seth Williams" <sm@here.comwrote in message
news:ev**************@TK2MSFTNGP04.phx.gbl...
>>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?


Jun 27 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Steve Franks | last post by:
I am trying to access strongly typed properties in a page's master page from the content page. I followed an article that describes how to do this, and it seems quite straight forward. However...
4
by: Steve Franks | last post by:
I have this cool nested master page scenario working great. However what is the correct way to be able to access a strongly typed property at the top level master from a content page that has a...
1
by: Joey | last post by:
Hello, I have tried to programmatically set the theme for my master page by putting code in a "Page_PreInit" fuction in the master page's code behind. However, when I set a breakpoint there and...
2
by: Mark Rae | last post by:
Hi, It's easy enough to get a content page to refer to public properties on its associated master page e.g. public partial class master_secure : System.Web.UI.MasterPage { public Label...
4
by: Suresh | last post by:
Is there any way to access the custom properties of a master page from the aspx form? I know the custom properties of a master page can be accessed from the aspx.cs partial class by specifying...
4
by: evantay | last post by:
I'm using ASP.NET 2.0 with VS.NET 2005. I'm trying to access properties from my master pages within a page that inherits from that master page (a child page). However the values are always null....
0
by: dixonjm | last post by:
Hi, I have a master page & various pages that will use this master page. Each content page will have a CSS & JS file which will be named the same as the content page. When I try to load the CSS...
3
by: Mick Walker | last post by:
Hi All, I have a user control on my master page, which exposes 3 public properties (all boolean). Basically by the values of these properties, the user control builds a menu to for users to...
4
by: lichaoir | last post by:
I have two questions about the use of Master Page: 1. How to access properties and controls in the master page from content page? (I know I can use the "FindControl()" method of the "Master"...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.