473,385 Members | 1,445 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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.Redirect() 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 1512
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.Handler 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**********@yahoo.comI-WANT-NO-SPAMwrote in message
news:ez**************@TK2MSFTNGP05.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.Redirect() 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.Handler 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
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...
0
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...
13
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?...
3
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,...
1
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...
2
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"...
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....
6
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" %>...
10
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.