ASP.NET forms authentication - auto login with a test account while debugging?

后端 未结 7 1853
囚心锁ツ
囚心锁ツ 2020-12-31 18:21

I have a web application that uses the asp.net membership and role providers to allow logins that are members of certain roles to have access to various pages depending on

7条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-31 18:52

    The FormsAuthentication.RedirectFromLoginPage uses the defaultUrl to decide where to redirect after login. So make sure, you have a valid url other than your LoginPage.aspx defined.

    FormsAuthentication.RedirectFromLoginPage("userName", True);
    
    
        
    
    

    I hope this helps a bit.

提交回复
热议问题