473,516 Members | 2,910 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Context.Items lost using Server.Transfer

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.
Nov 18 '05 #1
2 2128
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.
--
Peter O'Reilly
Nov 18 '05 #2
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?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #3

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

Similar topics

1
3425
by: | last post by:
When passing values from one page to another using context.items collection & server.transfer, how secure is this data? This is using the notion that you add an item to the context.items collections I am thinking that since you are processing the source page on the server, then transfer to the destination page, all of this is happening on...
0
2039
by: Srini | last post by:
I am implementing Front Controller in ASP.net as outlined in Microsoft documentation titled "Implementing Front Controller in ASP.NET Using HTTPHandler" (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpatterns/html/ImpFrontControllerInASP.asp Everything works well except for context.server.transfer(string url) method (refer...
2
270
by: LJ Jurkovic | last post by:
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...
2
1711
by: Rea Peleg | last post by:
Hi eb I am adding in webForm1.aspx some item to the context items collection in order to extract it in the next aspx page: In webForm1.aspx - c# code behind - i do: --------------------------------------------------------------- Context.Item.add("variableName",variableVaue); //test that add item succeeded: string test =...
2
1693
by: dave | last post by:
This little problem is driving me nuts!! On my webform page I create 2 variables.. Protected p_dml As String = "I" Public Const mwv_id As Integer = 0 ' originally had mwv_id as Protected
6
3838
by: Roman | last post by:
Which is better when passing values between forms?
8
1642
by: Steph | last post by:
Hi, Is it better to use the URL method to send informations to a page, or to use the context method ? Thanks.
4
2128
by: nicholas | last post by:
I'm using context to transfer variables from 1 page to another. But, with more than 2 pages it fails. Ex: page1.aspx: Context.Items.Add("customername", customername.text) Server.Transfer("page2.aspx") page2.aspx: response.write(Context.Items("customername")) => returns the customername
1
1436
by: Hugo Flores | last post by:
Hi, I'm trying to pass information between pages. I'm trying to avoid using QueryString and Session variables. I saw somewhere that I could use contxt.Items.Add (combined with Server.Transfer) to store my information and send it to another page. Some of my pages, either go to other pages, or postback depending on the situation. When I began...
4
1292
by: Hugo Flores | last post by:
Often people post questions about how did they loose their context between pages, and the more common cause is that they don't store the context on the viewstate upon postbacks. Mine is the other way around. Even though I don't fill the context object, I still get it after the Page Load event. May be I'm not understanding the context object...
0
7276
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
7182
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7408
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7581
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...
1
5110
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4773
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
3259
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1624
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
0
488
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.