Click here to Skip to main content
15,888,527 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionHow to ReturnURL? Pin
Jassim Rahma9-Apr-13 1:53
Jassim Rahma9-Apr-13 1:53 
AnswerRe: How to ReturnURL? Pin
AmitGajjar10-Apr-13 1:15
professionalAmitGajjar10-Apr-13 1:15 
GeneralRe: How to ReturnURL? Pin
Jassim Rahma10-Apr-13 3:06
Jassim Rahma10-Apr-13 3:06 
GeneralRe: How to ReturnURL? Pin
AmitGajjar10-Apr-13 3:10
professionalAmitGajjar10-Apr-13 3:10 
QuestionQuestion of the day post on a web page Pin
Member 87742808-Apr-13 20:25
Member 87742808-Apr-13 20:25 
QuestionDoes Response.Redirect("~/MyPage.aspx", true); clear session on redirect? Pin
Steve Holdorf8-Apr-13 12:04
Steve Holdorf8-Apr-13 12:04 
AnswerRe: Does Response.Redirect("~/MyPage.aspx", true); clear session on redirect? Pin
jkirkerx8-Apr-13 12:38
professionaljkirkerx8-Apr-13 12:38 
GeneralRe: Does Response.Redirect("~/MyPage.aspx", true); clear session on redirect? Pin
Jasmine25018-Apr-13 12:56
Jasmine25018-Apr-13 12:56 
The second argument terminates the current response. It's a good idea to set that to true usually.

You are correct, and in my experience this holds true - nothing in the Response.Redirect behavior affects session values.

Possibly he's storing sessions without cookies, and he's losing the query string value which is used in that case to keep the session alive.

Keep in mind, Response.Redirect is a CLIENT-SIDE redirect, meaning control goes back to the browser, and it requests the new page. When that request comes in, it looks like a new request, so if there's no cookie to tell the server the SessionID, it's going to be lost if you don't pass the query string value back as part of the redirect URL. I often take advantage of that to "reset" the current page by redirecting back to itself.

In other words... this might work...

C#
Response.Redirect("~\Page.aspx?" + Request.QueryString.ToString(), true);

GeneralMessage Closed Pin
8-Apr-13 13:14
professionaljkirkerx8-Apr-13 13:14 
GeneralRe: Does Response.Redirect("~/MyPage.aspx", true); clear session on redirect? Pin
Jasmine25019-Apr-13 5:55
Jasmine25019-Apr-13 5:55 
QuestionA potentially dangerous Request.Form value was detected from the client Pin
Member 98570608-Apr-13 11:18
Member 98570608-Apr-13 11:18 
AnswerRe: A potentially dangerous Request.Form value was detected from the client Pin
jkirkerx8-Apr-13 12:46
professionaljkirkerx8-Apr-13 12:46 
Questionemail is going as spam / not reaching destination Pin
Jassim Rahma8-Apr-13 3:04
Jassim Rahma8-Apr-13 3:04 
AnswerRe: email is going as spam / not reaching destination Pin
Jasmine25018-Apr-13 6:55
Jasmine25018-Apr-13 6:55 
AnswerRe: email is going as spam / not reaching destination Pin
jkirkerx8-Apr-13 8:10
professionaljkirkerx8-Apr-13 8:10 
GeneralRe: email is going as spam / not reaching destination Pin
Jasmine25018-Apr-13 11:07
Jasmine25018-Apr-13 11:07 
GeneralRe: email is going as spam / not reaching destination Pin
jkirkerx8-Apr-13 12:32
professionaljkirkerx8-Apr-13 12:32 
GeneralRe: email is going as spam / not reaching destination Pin
Jasmine25018-Apr-13 13:00
Jasmine25018-Apr-13 13:00 
QuestionAJAX Image Loading Pin
Rockstar_8-Apr-13 1:19
professionalRockstar_8-Apr-13 1:19 
AnswerRe: AJAX Image Loading Pin
Karthik Harve8-Apr-13 1:55
professionalKarthik Harve8-Apr-13 1:55 
QuestionMVC 4 Maintain state of the check box,Drop down list Pin
VishwaKL8-Apr-13 0:34
VishwaKL8-Apr-13 0:34 
Question__EVENTTARGET is undefined Pin
GGev7-Apr-13 23:32
GGev7-Apr-13 23:32 
AnswerRe: __EVENTTARGET is undefined Pin
Karthik Harve8-Apr-13 2:01
professionalKarthik Harve8-Apr-13 2:01 
QuestionHow solve (Validation of viewstate MAC failed)? Pin
Jassim Rahma7-Apr-13 0:38
Jassim Rahma7-Apr-13 0:38 
AnswerRe: How solve (Validation of viewstate MAC failed)? Pin
AContractor7-Apr-13 1:48
professionalAContractor7-Apr-13 1:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.