登录后重定向到上一页的asp.net代码 [英] asp.net code for redirect to previous page after login

查看:70
本文介绍了登录后重定向到上一页的asp.net代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请任何人可以帮助我提供asp.net代码,以便在登录后重定向到上一页而不是目标页面.

在此先感谢

Please any one can help me to provide me the asp.net code for redirect to previous page after login instead of destination page.

Thanks in advance

推荐答案

如果您使用的是基于表单的身份验证,则ASP.NET运行时应通过URL的RETURNURL查询字符串部分自动对其进行处理,请参考以下URL进行具体了解

http://msdn.microsoft.com/en-us/library/ff647070.aspx [ ^ ]
If you are using form based authentication, then it should be taken care by ASP.NET runtime automatically by the RETURNURL query string part of the URL, refer the following URL to have a concrete understanding

http://msdn.microsoft.com/en-us/library/ff647070.aspx[^]


您可以使用Response.Redirect()以编程方式将浏览器重定向到特定页面.

在您的情况下,验证完成后,您可能必须将其添加到Login事件处理程序中.
但是由于您根本没有提供任何代码,所以这只是一个疯狂的猜测.
You can use Response.Redirect() to programmatically redirect the browser to a specific page.

In your case you probably have to add this to your Login event handler, after the validation has been done.
But since you didn''t provide any code at all this is just a wild guess.


这篇关于登录后重定向到上一页的asp.net代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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