返回URL概念ASP.NET [英] Return URL concept in ASP.NET

查看:115
本文介绍了返回URL概念ASP.NET的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的要求是这样的。每当我不会在我的网站上登录之后再也没有访问网页。但在登录页面的URL手段(返回URL)后成功登录到我的网站后添加链接的页面重定向到我所访问,并进入地址栏相同的页​​面。

My requirement is this. whenever i would not be login in my site then never access a web page. but the url added after the login page url means (return url) and after successful login into my site the page redirect to same page which i have to access and entered into address bar.

例子:我在访问网页的 HTTP:userdetail.aspx 没有登录14334 /用户/://本地主机。该页面返回给我上的的http://本地主机:14334 /的Login.aspx 。但我想,该页面返回给我上的的http://本地主机:14334 /的Login.aspx RETURNURL =%2fUser%2fuserdetail.aspx

Example: i have to access page http://localhost:14334/User/userdetail.aspx without login. the page returns to me on http://localhost:14334/Login.aspx. but i want that the page returns to me on http://localhost:14334/Login.aspx?ReturnUrl=%2fUser%2fuserdetail.aspx

推荐答案

听起来像是你缺少的是重定向呼叫:

Sounds like all you are missing is the call to redirect:

FormsAuthentication.RedirectFromLoginPage(UsernameTextbox.Text, NotPublicCheckBox.Checked);

有关详细信息,请参阅本 - http://msdn.microsoft.com/ EN-US /库/ ka5ffkce.aspx

See this for more information - http://msdn.microsoft.com/en-us/library/ka5ffkce.aspx

这篇关于返回URL概念ASP.NET的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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