开发者

HttpContext.Current.Session.IsNewSession still true after redirect

开发者 https://www.devze.com 2022-12-20 17:43 出处:网络
I am trying to redirect to the same page with different query string parameters HttpResponse resp = HttpContext.Current.Response;

I am trying to redirect to the same page with different query string parameters

HttpResponse resp = HttpContext.Current.Response;
开发者_开发技巧
resp.Redirect(landingPagePath)

To avoid further processing after redirection i check if

HttpContext.Current.Session.IsNewSession == false

but for some reason i found that this is not always the case after redirection

can anyone please tell why is this happening

Thanks


Why don't you use your Page.IsPostBack flag instead? It will be false when you redirect the page back on itself with the modified querystring.


If you are trying to avoid further processing (your description is vague), maybe you could pass an additional parameter to indicate that you just redirected.. and determine what to do based on the value of that parameter..

0

精彩评论

暂无评论...
验证码 换一张
取 消