【发布时间】:2013-10-10 16:56:39
【问题描述】:
在使用 ASP.NET 应用程序时,我有时会遇到在 Visual Studio 中链接到页面的问题。
我创建了指向页面的链接,但它们总是重定向到默认链接(Default.aspx)
- 我尝试了各种方法,例如删除和重新创建
- 重命名页面
- 即使页面不存在,它仍然会重定向到默认值 页面。
我的Login.aspx 页面与ForgotPassword.aspx 是同一个文件夹我创建这样的链接
<asp:HyperLink ID="HyperLink2" runat="server"
NavigateUrl="ForgotPassword.aspx">
Forgot your password ?
</asp:HyperLink>
或
<a href="ForgotPassword.aspx">Forgot your password ?<a>
我不明白为什么这些基本的东西会不起作用...... 我该如何解决这个问题?这可能是一个错误吗?
编辑: 浏览器中的 Url 如下所示:
/Account/Login.aspx?ReturnUrl=%2fAccount%2fForgotPassword.aspx
我的网络配置:
<authentication mode="Forms">
<forms loginUrl="~/Account/Login.aspx" timeout="2880" />
</authentication>
【问题讨论】:
-
您可能会在 ForgetPassowrd 页面上进行检查。这会将您重定向回 default.aspx.. 检查 ForgetPassword 页面的页面加载方法。
-
你能发布你的web.config吗,对我来说更像是一个身份验证问题,如果你点击了正确的页面然后得到重定向,请检查谷歌浏览器......
-
@Pedro 有道理请看我的编辑。
-
你试过了吗?
标签: c# asp.net visual-studio-2010 hyperlink