Page.Request Property With MasterPage

S

senfo

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,
 
K

Kevin Spencer

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.
 
S

senfo

Kevin said:
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,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top