简体   繁体   English

设置页面以登录aspx后重定向

[英]Set Page to redirect after login in aspx

I use a System.Web.Security.MembershipProvider to do my login-stuff on my aspx-Page. 我使用System.Web.Security.MembershipProvider在aspx-Page上进行登录。

My default page is stored in Pages/Default.aspx. 我的默认页面存储在Pages / Default.aspx中。

I defined this page as default page in iis. 我将此页面定义为iis中的默认页面。 When I call my page via server /Pages/Default.aspx and do the login, everything works fine. 当我通过服务器 /Pages/Default.aspx调用页面并进行登录时,一切正常。

But when I call only server and do the login here, I'm redirected to server /Default.aspx (without the Pages-directory) -> which leads to an error, page not found... 但是,当我仅调用服务器并在此处登录时,我将重定向到服务器 /Default.aspx(无Pages目录)->这将导致错误,找不到页面...

Is there a way to prevent this, without changing the folderstructure of my project? 有没有一种方法可以防止这种情况,而无需更改项目的文件夹结构?

EDIT: 编辑:

My Login-Control on the master-page: 我在主页上的登录控件:

<asp:Login ID="LoginBox" runat="server" Width="339px" DestinationPageUrl="/Pages/Default.aspx" FailureText="Username or password wrong!">

我认为您需要在aspx页面上找到应用程序上下文文件夹结构代码,请参考: 如何在不使用HttpContext.Current的情况下获取ASP.NET Web应用程序的物理位置?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM