Query string and session variables lost after redirect

Hi,

I'm trying to redirect a user form one application to another by using response.redirect().

I need to pass a returnURL so I'm doing this through a query string:

In myapp1 I call:

Response.redirect(http://localhost/myapp2/logon.aspx?ReturnUrl=http://www.mysite.com, true)

When debugging the myapp2, in page_load of logon.aspx.cs I've lost the query string AND some session variables I stored. The session ID is the same....

Any idea? Any configuration to be set in web.config?

Thanks a lot,

Claudio

0
calberti
2/27/2007 10:21:44 AM
asp.net.state-management 8807 articles. 0 followers. Follow

0 Replies
829 Views

Similar Articles

[PageSpeed] 36

Reply:

Similar Artilces:

how to redirect query string of domain1 to the query string of domain2?
 Hello members!i have two websites made in asp.net 2.0 and i want to redirect the query string of domain1 to the query string of domain2, for examplei want to redirectwww.domain1.com/example.aspx?f=helloTO www.domain2.com/example.aspx?f=hellohow can i do it? can i do it in web.config file? Please help me out. i really need to do this. Thanks in advance. waiting for your replies.Arbaz www.funscarpe.comwww.123friendster.com in domain1 write this line i the page load event String qs=Request.Querystring["f"].tostring(); and in the redirecting code write this response.redirect...

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

how to pass multiple variable to response.redirect, retrieve data from query string and pass those values to label.text or any variable
Hi can anyone tell me how to pass multiple variable to response.redirect, retrieve data from query string and pass those values to label.text or any other variable Read this , http://www.codeproject.com/KB/aspnet/QueryString.aspxRegards,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!...

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

Query String vs. Session Variable
I need to pass certain key information (lets call it Customer Number) from one page to another. Which of the following methods is better and why? Passing Customer Number in the Query String Passing Customer Number in a Session Variable Another method that I am unfamilar with? Thanks    You can use hidden variables.You can also use context variable with Server.Transfer method for moving one page to another.Session are fine but above 2 are better. Shah Dharnendra GSr.Analyst Programmer,GTL-Ahmedabad As far as I know there is no "right" answer to your q...

Comparing string variables and session state
Ok I am trying to compare two string values in this block private void btnCheck_Click(object sender, System.EventArgs e) { if (Session["OldAnswer"].ToString() == textAnswer.Text.ToString()) { lblAnswer.Text = "Correct"; } else { lblAnswer.Text = "Nope this is the answer\t" + Session["OldAnswer"].ToString() + '\t' + "This is what you put in " + textAnswer.Text.ToString() + '\t' + "this is the old answer " + Session["OldAnswer"].ToString(); } ...

State management upon session variable changes
I noticed that whenever a session variable is changed...the application knows about it and suddenly restarts session. My question is does restart "ALL" sessions or only the active sessions for which the variables changed? Imagine a "multi-user" application all with different states and an administration panel that lets you change session variables.  In this case, my question has to do with the question that if Company X changes his session variables, will only Company X's sessions be reset or will all "sessions" be reset?  Hope that makes sense. ...

grabbing and posting session state data to a query string
I have enabled session stating on an application I have written by modifying the web.config to write to a SQL database, after I ran the state script with the query analyzer provided by the .NET framework installation (I think it is installsqlstate.sql). The session data appears to be writing correctly, however I have some questions regarding putting data into these tables built, and extracting data from them. I am trying to write the username to the database (to the temp database that was created that holds the session information), the application uses windows integrate...

Saving TextBox String In Session State When Redirecting To Another Page
I am using a custom GridView with a CheckBox on each row. All of the primary keys of guest records selected in the GridView are saved into an ArrayList, Session("GuestIDs"). This is done via a button 'Save Selections' calling a server side procedure as follows. Protected Sub btnSave_Click(ByVal sender As Object, ByVal e As System.EventArgs) sbSaveTickedGuests() End SubI can also call the above procedure on gridview PageIndexChanging, and Sorting events which saves having to save selections manually before those events. O...

Lost session variables on redirect after cross-domain httppost request
Hi all, I have an asp page with an httppost request to bypass login for another .net page on another domain.  This works fine and returns the results as expected.  I am having difficulty when navigating away from the resulting page as the post request I have made is simply response.write of the xml returned so the page stays on the old domain without a redirect to the new site.  Therefore any links I have on the new page do not work without using the fullpath to the page, same goes for any buttons which do postback as the page does not exist...

Opinions on Viewstate vs. Session variable for state management on dataset
I came across many sample codes that using ViewState(myDataSet) and Session("myDataSet"). Which is a better way to use to keep the session around. What are the pros and cons? Anybody can share with your experience or thoughts? Thanks, teresa Take a loot at this article: State Management in Web Forms http://www.c-sharpcorner.com/Code/2004/Feb/StateManagementInWebForms.aspDarrell Norton, MVPDarrell Norton's BlogPlease mark this post as answered if it helped you!...

Web resources about - Query string and session variables lost after redirect - asp.net.state-management

Variable - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

Westpac interest rate rise is one of many variable loan rate rises
WESTPAC is not alone in hitting its owner-occupier customers with a surprise interest rate rise, as dozens of other variable rate home loans ...

Airbnb upgrades variable pricing tool for hosts
Online home rental group Airbnb is rolling out an upgraded variable pricing tool that automatically raises or cuts room rates based on supply ...

Commonwealth Bank raises variable home loan rates
Home owners' mortgage costs are set to rise by hundreds of dollars a year, after the Commonwealth Bank became the latest bank to hike interest ...

CBA lifts variable home loan rates to offset costs associated with stricter capital requirements
The Commonwealth Bank to lift its home loan interest rates independently of the Reserve Bank to partially offset costs associated with stricter ...

Washington Square Signs Spielbergs, Choi Joins Variable and More
... films and an episode of the HBO comedy series "Girls," on which he plays the role of Ray Ploshansky. New York-based creative collective Variable ...

YouTube v10.32 Tweaks Some Interface Elements And Includes Hints About Virtual Reality Content And Variable ...
Forget Update Wednesday! Monday is the new big day. Not only were we treated to the latest M preview release and the official Marshmallow name, ...

"You have to ignore many variables to think women are paid less than men. California is happy to try." ...
Writes Sarah Ketterer in The Wall Street Journal in "The ‘Wage Gap’ Myth That Won’t Die" (which you can get to without subscribing if you Google ...

Expert Reveals the Latest Variable Capacity Technology
Learn about gForce Ultra CRAC equipment, the latest variable capacity technology to lower energy usage and increase reliability.

AD/CVD ruling and overseas capacity expansions are variables to the current PV boom, says EnergyTrend ...
China's National Reform and Development Commission has announced that there will be no significant reduction in feed-in tariff (FiT) rates for ...

Resources last updated: 12/19/2015 4:35:40 PM