开发者

asp.net LoginView keeps redirecting to default.aspx, how to change?

I have a LoginView control on my homepage, when i click 'Login' it开发者_如何学JAVA goes to the log in page. When the details are authenticated, it redirects to default.aspx, I don't have a default.aspx - where can I change this?

This is the only thing I can see wrong:

FormsAuthentication.RedirectFromLoginPage(Login1.UserName, Login1.RememberMeSet);


Set the defaultUrl specifies where to go after.

http://msdn.microsoft.com/en-us/library/1d3t3c61.aspx


I don't think you want this on your login control. FormsAuthentication.RedirectFromLoginPage(Login1.UserName, Login1.RememberMeSet); because this would be coming in from a a login page rather then control.

I think you want change the control from being a login, to more of a "Logged In" control. IE: hide the username and password and display a label which states "Logged in as xxx/Logout Link.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜