Context.Items lost using Server.Transfer

L

LJ Jurkovic

Has anybody encountered a situation like this: Inside Page1.aspx I'm
using Server.Transfer("Page2.aspx") to get to Page2.aspx. I save few
values in Context.Items which I try to restore in Page2. Most of the
time everything works fine, but from time to time the Context items
are completely lost by the time they get to Page2. It happens only in
production so my abilities to debug this are very limited. Are there
any known circumstances that this can occur?

Any help is greatly appreciated,
L.J.
 
P

Peter O'Reilly

Your answer lies in the overloaded methods of the Server object's Transfer
method.
Two of them if I recall; the solution lies in using the other one.
 
L

L.J.

Thanks for the reply.
There is and overload to Server.Transfer where you can pass the second
parameter which is bool preserveForm. The documentation states that
passing false would clear Form and QueryString collections. This is the
default value if you omit the second parameter. I guess I can use
preserveForm=true, but I don't see how's that relevant to the
Context.Items collections. Context object is supposed to live only
during the execution of current request. Am I missing something?
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top