PC Review


Reply
Thread Tools Rate Thread

Accessing masterpage properties from server.transfer page?

 
 
evantay
Guest
Posts: n/a
 
      26th May 2007
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.

In my masterpage I have this:

private bool m_AlreadyTested;
public bool AlreadyTested
{
get { return m_AlreadyTested; }
set { m_AlreadyTested = value; }
}

Then within the Page_Load of the master page I am doing this:

if certainConditions == true then
AlreadyTested = true;
Server.Transfer("/error.aspx");
end if

Then in error.aspx child page (derrived from the master page) I do this from
its Page_Load event:
Response.Write(Master.AlreadyTested.toString());

However the AlreadyTested always displays as FALSE, even though itis hard
coded to True. When I step through in the debugger I can see it is set to
True just prior to the Server.Transfer. But once it gets into the transfered
page everything is nulled out and bools are set to False.

Similarly I have other properties I've set to valid object instances prior
to the .Transfer and afterward those are all Null too.

What is going on here? I thought under ASP.NET 2.0 I could tap into the
master page properties even from exceution of the .Transfer pages?

Thanks!


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Accessing MasterPage Properties from a usercontrol on a contentpage?? wildman@noclient.net Microsoft ASP .NET 2 26th Feb 2008 01:33 PM
Accessing Properties in masterpage from content file Rick Microsoft ASP .NET 8 16th Aug 2007 02:42 AM
Accessing master page properties from server.transfer page? evantay Microsoft ASP .NET 4 30th May 2007 11:17 AM
Accessing usercontrol properties from another page - SERVER-SIDE John Microsoft ASP .NET 2 17th Oct 2004 04:50 PM
Accessing another page's viewstate after server.transfer Microsoft Dot NET 1 10th Aug 2003 11:55 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:01 PM.