Click here to Skip to main content
15,612,595 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello everyone,

I,am facing a small issue ie-
In our eCommerce app,we have a product details page where in both Store ID n Product ID gets passed, if user is a guest without login,when user click on add to cart we force him to lo-gin to put product in cart, during login page, both product id and store id gets passed but after successful login redirect to same product details page only Product id gets passed not the store ID therefore there's an error of data missing of product details page and same with sign-out.

Let me know how to resolve these 2 query strings passed after user lo-gin authentication successful.

Viraat Kothare

1 solution

in web.config set the login page url
<authentication mode="Forms">
  <forms loginurl="~/User/Login.aspx" timeout="2880" />

in login page code, after successfully login you can redirect using Request["ReturnUrl"]
string strRedirect = Request["ReturnUrl"];
if (strRedirect == null)
    strRedirect = @"~/Default.aspx";// set your default home page

Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900