Last variables stored in Session get lost when redirecting to _target page.

 We have a session object that holds certain data - on our last panel of our panel wizard we ask two questions:

 checkbox :  Use pre-printed paper?

radioBox:  Most recent test   

                All past tests

 

we save those two variables to our session like several other variables that we have saved.
 
This then Redirects to a _target page that builds our report.  HOWEVER, alot of the time (AND NOT ALWAYS) these last two variables do not get populated to our session? 

If I debug and put a stop on the landing page where I create the variable dim scope as integer = Request("Scope")    USUALLY the first time Request("Scope") is empty.  BUT, if I close my landing page, go back to my report page, click on the radio button again and THEN submit it again, the variable is filled in.

 

Are we going to fast?  Is there a problem with going from a last panel to a _target page????  Help?
 

0
tvhkusa
3/31/2008 6:01:21 PM
asp.net.state-management 8807 articles. 0 followers. Follow

4 Replies
747 Views

Similar Articles

[PageSpeed] 25

Are you sure your not redirecting, before the session variables are set?  Can you post more detailed code?


Matt
Chief Architect
Software Engineer
Smooth Fusion, Inc.
http://www.smoothfusion.com
0
dotnetbohn
3/31/2008 6:27:11 PM

Actually, I think we are.... thank you.

 

I'm going to dig in that direction and will let you know if I cannot get it from there.

 

Thanks again!!!

 

0
tvhkusa
3/31/2008 6:44:13 PM

you are talking about session issue but you mentioned that you are getting the value like this

 

tvhkusa:
dim scope as integer = Request("Scope")  

note that , to get the session value , you need to use the following sytax :

dim scope as integer = session("Scope")

and not the mentioned one , your mentioned code will get the Value passed via query string !

 


Regards,

Anas Ghanem.


Note:Please Don't hesitate to click "Report Abuse" link if you noticed something wrong on the forums (like duplicate ,Off-topic,offensive,or any post that violates the website "TERMS OF USE"). -- Thanks!

0
anas
3/31/2008 6:47:55 PM

 Thank you.   That is what I meant to write.  I had made the variable pass via URL and that is what I had currently been using.  Sorry and thanks for the clarification.

 

And yes, I was redirecting on my markup side before OR the same time that I was saving the variables to session on the code behind.  Thank you for your help! 

0
tvhkusa
3/31/2008 7:09:28 PM
Reply:

Similar Artilces:

Session variables lost after a redirect page
Hi all , I have encounter a session variable lost after a redirect page when i set the cookiesless=false in web.config. This happen when u i tried to access the asp.net application from another pc while my asp.net application reside in another web server. therefore in order to solve this problem i tried to change in the web.config file by setting the cookieless =true than it works. <sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes" cookieless="true" timeout="20"/> how can i have this prob...

I want to use a function to store some session variables temporarily, abandon all session variables, and then call the ones back that I stored temporarily
I have a function that I am calling (SessionResetKeepingStaticParameters) that I want to cal to be able to abandon a complete session, but keeping certain one and calling them back after abandoning them.  I can't get it to work.  Any ideas  Thanks From what I understand, you are Abandoning a session, but want to keep one session variable available, and would like to be able to retrieve this after abandoning the session. If thats not what you meant, please explain If you call Session.Abandon() to abandon a session, you can not keep any session variable alive after that,...

Session variable lost in redirect
I am having a problem with loosing a session variable after I redirect to another page. Here is my code:login.aspx: if(sAuthorized != "-1" && sAuthorized != "-2") { Session["user"] = sAuthorized; Response.Redirect("index.aspx"); }index.aspx:private void Page_Load(object sender, System.EventArgs e) {    CheckLogin();    string sUserID = Session["user"].ToString();    DataSet ds = SqlHelper.ExecuteDataset(DataAccessLayer.ULTConn(), "sp_get_users_courses",    new SqlParameter("@user", SqlDbType.VarChar, 20).Value = ...

Session Variables getting lost
Hi I have a Parent Page called Parent.aspx in which i have a Grid View which has a column in which button is placed from which i am opening a Pop Up Window(Page) named Child.aspx. Before opening th pop up i assigning a DataTable to a Session variable so that i can access the DataTable in Child.aspx which can be accessed.Now I have created the 2nd DataTable in Parent.aspx for which the rows are added in the child.aspx page. The 2nd DataTable need to maintain all the rows which are added in child.aspx page. but unfortunately i am not getting  the DataTable from the Session .If i make...

session variable gets lost
Hi! I have a session variable, and I set the Session.timeout=120; but after a while (not even 30 mins )it got lost and had errors cause of that in the app_code, where I have a function that takes as parameter the session variable value. Thank for any advice. Firstly make sure you are never overwriting the session variable.Another thing would be if the web server is low on resources it may drop some session items.  Make sure in the web.config file the session timeout is set properly     <sessionState timeout="120"/>Check below link for more info ht...

The page requires session state that is no longer available. Either the session has expired, the client did not send a valid session cookie, or the session state history size is too small. Try increas
Hi.. I am making a mobile application using .net framework 2.0. My Application has  web farm scenario so for state management  I am using Sateserver in my application. My application runs fine if I dont use web farm scenario But in case of web farm scenario it is giving me error "The page requires session state that is no longer available. Either the session has expired, the client did not send a valid session cookie, or the session state history size is too small. Try increasing the history size or session expiry limit."   &...

"The page requires session state that is no longer available. Either the session has expired, the client did not send a valid session cookie, or the session state history size is too small. Try increa
Hi.. I am making a mobile application using .net framework 2.0. My Application has web farm scenario so for state management I am using Sateserver in my application. My application runs fine if I dont use web farm scenario But in case of web farm scenario it is giving me error "The page requires session state that is no longer available. Either the session has expired, the client did not send a valid session cookie, or the session state history size is too small. Try increasing the history size or session expiry limit." I am not getting why this error is coming ..Though I already h...

After a looong night managed to change Session mode from inProc to SQLServer but still can't get the session variables to be saved
Hi,  I ran my Shopping Cart project and somehow everything worked fine(while in inProc), session variables were saved fine. I made some changes to my project and since then keep getting null session variables, no matter what I do. It took me the whole night to figure out how to turn to SQLServer mode,  marked custom classes as 'Serializable' with [Serializable] before the class definition but everything's in vain. Getting the same damned 'nulls' instead of the saved objects. private void Page_Load(object sender, System.EventArgs e)         {...

Session variable value gets lost
I am using asp.net 3.0 with C#. My web application requires some values that is used across my User Controls. These values are pertaining to the login user name and User type. When each user is logged in I store that username and user type in a session variable and whenever i need to used it like in a query I just called the string variable that is assigned to the Session variable. My problem is sometimes my session object/ string variable loses its value and I am wondering is there another way of storing my User's credential so that the value will not be lost until the User closes his/h...

Store checkbox state in Session variable
Hi,  I have checkbox control in Page1.aspx.I have a button in Page1.aspx.On button click,it goes to Page2.aspx. I have a edit button in Page2.aspx.On clicking the edit button,it goes to Page1.aspx.So Page1.aspx should have data in the controls which it had originally. I am not sure how to store the boolean value or checked state of checkbox in Session variable.Please guide me. Thanks, pcs   Before you load the page2 store the checkbox value into the session variable like this Session["Page1Sessionvariable"] = CHECKBOX1.Checked.ToString(); On the page_load of pag...

Session State variable missing after Redirect
When an error occurs, I set a session variable so that after redirecting to an error page, a detailed explanation can appear.  The variable (a string) is gone by the time I reach Page_Load in the target page.  I've checked and it is the same session ID. Any ideas? Are Sessions enabled? Are you forwarding to a page outside of you application?View My Blog Download My URL Rewriter and Reverse ProxyOnly $9.95/month, ASP.NET, 2GB & SQL 2005...

Session Variables lost after Response.Redirect()
Hi gurus,  I encouter lost session variables trouble when Response.Redirect() to another aspx page. I set 19 Session variables before redirecting. However, the redirected page's session contains only One variable. The very weir sympton is: If I restart IIS, only for the first IE encounter, the redirected page DOES show all 19 session variables.Once I close IE, any further IE or IE from any other machine's only shows ONE session variable. I can also reproduce such symptons in VS2005 development environment. Can someone tell me what I have missed?   Thanks! Here is ...

Session state lost when url is an redirect
Hi, I have a website (www.mysite1.com) and created a implementation of user validation (just a validate with database and save it into the session). The user data will be saved in Session, to make this information available through the application. This works fine. However, there exists also a website (www.mysite2.com), but this only a redirect to "mysite1". This redirect will keep the url of "mysite2" in the address bar. Now the part i don't get: When login through "mysite2" the userdata isn't persisted. Could anyone tell me why the second website give these problems? tx, RamR0m d...

Session variables lost between page requests
Hi We're getting a problem where session variables are lost between page requests. I set a session variable (affilaite id) when a session starts in session_start event in global.asax. With tracing enabled i can see that this variable is resident on the initial page request. When i navigate to a new page however, all session variables are lost. This has only just started happening fairly recently and I cannot find any particular piece of code that may be causing it. I've read stuff on the web about worker process recycling but if this is happening every time the user requests a page then so...

Web resources about - Last variables stored in Session get lost when redirecting to _target page. - asp.net.state-management

Advertise - Redirecting - YouTube
Search Call us: 1-855-500-2756 Get started Overview Why it Works Success Stories Get Started Make Video Ads Resources This page has moved. Redirecting ...

Aboriginal funds need redirecting - report
Aboriginal funds need redirecting - report

Freedom of speech: Redirecting our society to a dangerous course
Freedom of speech: Redirecting our society to a dangerous course

Leaked Federal Government mental health report recommends redirecting $1 billion from acute hospital ...
A report commissioned by the Federal Government recommends redirecting money from acute hospital care to community-based mental health services. ...

Sona talked of redirecting voters to wrong polls, court hears in robocalls trial
Michael Sona was overheard talking about American-style campaign politics to redirect voters to the wrong polling stations in the 2011 federal ...

Unscrupulous website adverts again redirecting some users to App Store from Safari
... granting any kind of permission… In iOS 8 beta 2, Apple supposedly had remedied the issue: “Safari now blocks ads from automatically redirecting ...

Play Store May Be Redirecting Some Search Terms To The Predefined Categories
The user experience on Android is never standing still, which is no more evident than in the Play Store itself. It seems Google may be trying ...

Redirecting...
Please wait — redirecting to new Business page...

Redirecting...
Click here if you are not redirected

Redirecting Financial Flow To Asia Pacific Crucial For Region’s Sustainable Growth
... (UNEP) notes, the Asia Pacific region is home to over half of the world’s population, but much less than half its natural resources. Redirecting ...

Resources last updated: 1/7/2016 3:31:43 PM