2查询字符串Pass [英] 2 Query strings Pass

查看:93
本文介绍了2查询字符串Pass的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我正面临一个小问题ie-

情景 -

In我们的电子商务应用程序,我们有一个产品详细信息页面,在商店ID和产品ID都通过,如果用户是没有登录的访客,当用户点击添加到购物车时,我们强迫他放弃将产品放入购物车,登录页面,产品ID和商店ID都被传递但成功登录后重定向到相同的产品详细信息页面只传递产品ID而不是商店ID,因此产品详细信息页面缺少数据错误,注销时也是如此。 />


让我知道如何解决用户lo-gin认证成功后传递的这2个查询字符串。





谢谢

Viraat Kothare

Hello everyone,

I,am facing a small issue ie-
Scenario-
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.


Thanks
Viraat Kothare

推荐答案

在web.config中设置登录页面网址

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



登录页面代码,成功登录后,您可以使用重定向请求[ReturnUrl]


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

Response.Redirect(strRedirect);


这篇关于2查询字符串Pass的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆