在某些情况下如何从同一登录按钮重定向到不同的页面? [英] How do I redirect to different pages from the same login button under some condition?

查看:82
本文介绍了在某些情况下如何从同一登录按钮重定向到不同的页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带登录按钮的登录页面。如果用户只是登录更新他的个人资料(如在任何在线网站中),但是如果用户从( .aspx)他被重定向到登录页面(和以前一样)

然后登录后用户应该再次重定向到(Bikes.aspx)。但我只能做一个以上,即如果我在response.redirect中给出Bikes.aspx而不是用于相同但不是用户配置文件。

I have a login page with a login button.Now suppose i want to redirect to user profile page if the user just login to update his profile (like in any online site),but if user buys a product from ("Bikes.aspx") he is redirected to login page(the same as before)
and then after login user should be redirected again to ("Bikes.aspx").But i am able to do only one of the above i.e if i give "Bikes.aspx" in response.redirect than it would go for the same but not to the user profile.






我的尝试:



i尝试使用if .... elseif ... else ...有一些会话但没有运气。



What I have tried:

i have tried using if....elseif...else...with some session but with no luck.

推荐答案

当用户被重定向到登录页面时,将他们离开的页面传递到登录页面查询字符串中。然后,一旦用户完成登录过程,重定向到查询字符串中传递的页面。
when the user gets redirected to the login page, pass the page they are leaving in the login page query string. Then once the user has completed the login process, redirect to the page passed in the query string.


这篇关于在某些情况下如何从同一登录按钮重定向到不同的页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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