473,569 Members | 2,729 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Page.Request Property With MasterPage

I'm in the process of converting an ASP.NET 1.1 application to ASP.NET
2.0 and one of the things I did was to add a MasterPage. The original
1.1 application relies heavily on the Page.Request property to retrieve
values between calls to the Server.Transfer () method. The problem is
that the Page.Request property on the new page does not contain any of
the values from the original page after the transfer.

The original developer used Server.Transfer () rather than
Response.Redire ct() for *every* redirect to a new page. This has lead
to a high dependency of the Page.Request property and updating the code
to use, for example, query strings, would be a rather time consuming ordeal.

Does anybody have any suggestions on the easiest approach to get through
this while keeping the code changes to a minimal? I've already started
to save everything to Context and then retrieve it back on the next
page; but, even that has been extremely time consuming and, at times,
difficult because of some irregular implementations .

Thank you in advance,

--
Sean

website: http://senfo.blogspot.com
Feb 27 '07 #1
2 1520
Get a reference to the original Page by creating a variable that is of the
type of the first page's class. Then set the value of the variable to the
HttpContext.Han dler property, casting it as the first Page's class.

--
HTH,

Kevin Spencer
Microsoft MVP
Software Composer
http://unclechutney.blogspot.com

I had the same problem once. Fixed it using the same solution.

"senfo" <en**********@y ahoo.comI-WANT-NO-SPAMwrote in message
news:ez******** ******@TK2MSFTN GP05.phx.gbl...
I'm in the process of converting an ASP.NET 1.1 application to ASP.NET 2.0
and one of the things I did was to add a MasterPage. The original 1.1
application relies heavily on the Page.Request property to retrieve values
between calls to the Server.Transfer () method. The problem is that the
Page.Request property on the new page does not contain any of the values
from the original page after the transfer.

The original developer used Server.Transfer () rather than
Response.Redire ct() for *every* redirect to a new page. This has lead to
a high dependency of the Page.Request property and updating the code to
use, for example, query strings, would be a rather time consuming ordeal.

Does anybody have any suggestions on the easiest approach to get through
this while keeping the code changes to a minimal? I've already started to
save everything to Context and then retrieve it back on the next page;
but, even that has been extremely time consuming and, at times, difficult
because of some irregular implementations .

Thank you in advance,

--
Sean

website: http://senfo.blogspot.com

Feb 28 '07 #2
Kevin Spencer wrote:
Get a reference to the original Page by creating a variable that is of the
type of the first page's class. Then set the value of the variable to the
HttpContext.Han dler property, casting it as the first Page's class.
That's not a bad suggestion. The problem is that there are multiple
entries into many pages and I don't want to miss anything. I've almost
completed the exhaustingly boring task of saving everything to Context
and then retrieving it on the target page. Other than rewriting very
large sections of code, I really couldn't think of a better solution.

Thank you very much for the response,

--
Sean

website: http://senfo.blogspot.com
Mar 1 '07 #3

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

Similar topics

1
1177
by: BenB | last post by:
Hi I have nested masterpages. On each master page there are some user web controls (ascx). I want to have common variables (strings, ints etc) that I can access throughout all parts of the page - the master page, user web controls and page itself. I just want to set them once on each page for performance reasons because a database query...
0
1154
by: zootius | last post by:
Hi - I'm working on a front-controller style application in ASP.NET 2.0. I have mapped all HTTP requests to ASPNET_ISAPI, and use an HttpModule to do a database lookup on the search-engine-friendly URLs that my app uses, in order to select the correct output for the context. Mapping the HTTP request to a physical ASPX page seems fairly...
13
6210
by: Michael | last post by:
I have setup a public variable in the Master Page "code-behind-file". Now I would like to set that value from the UserControl, but I can't seem to find a way to do this. Does anyone have any ideas? I'm basically trying to set it up so that I can keep the User infor (userid, ect) in the Masterpage so that other pages can access it. Thanks for...
3
2076
by: Alex Maghen | last post by:
Hi. I'm a little confused about the code that resides in the code-behind of a MasterPage and the code that resides in the code-behind of the actual pages that USE that MasterPage. I'm noticing, for example, that the Page_Load on the specific page executes before the Page_Load of its MasterPage. Is this right? But what I really want to...
1
3266
by: Dabbler | last post by:
I have some hyperlink controls on a master page I need to disable till my user has made some selections in a user control on a page based on the master page. How do I reference the Hyperlink controls in the master page? How can I get the Master Page to re-render itself after I've done this? Thanks for any suggestions on this. Dabbler
2
3823
by: Argirop | last post by:
I have a page Default.aspx. Its first line is the following: <%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="default.aspx.cs" Inherits="MyCompany.MyApp.default" Title="Untitled Page" %> The first line in MasterPage.master is the following: <%@ Master Language="C#" AutoEventWireup="true"...
4
3994
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. In my masterpage I have this: private bool m_AlreadyTested; public bool AlreadyTested { get { return m_AlreadyTested; }
6
9123
by: =?Utf-8?B?SmF5IFBvbmR5?= | last post by:
I am trying to access a Public property on a Master Page from a Base Page. On the content pages I have the MasterType Directive set up as follows: <%@ MasterType virtualpath="~/Master.master" %> On the Master Page I have a public property exposed: Public Property ErrorMessage() As String Get Return txtError.InnerText End Get
10
2112
by: =?Utf-8?B?RGFuaQ==?= | last post by:
Hi, Trying to create a master page that holds a menu, and the menu switches between pages in the site. 2 problem arrosed: a. When I navigate from page to page (all AJAX Web Forms, with the Master pages as their master...) the entire page is refreshed - also the menu which belongs to the master, how can I fix it - so only the inside...
0
7694
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8118
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7964
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6278
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5217
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3636
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2107
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 we have to send another system
1
1208
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
936
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.