R – How to use ASP.NET Login Controls when the Login.aspx is not at the root of the application

asp.netforms-authentication

I'm using the ASP.NET Login Controls and Forms Authentication for membership/credentials for an ASP.NET web application. It keeps redirecting to a Login.aspx page at the root of my application that does not exist. My login page is within a folder.

Best Answer

Use the LoginUrl property for the forms item?

<authentication mode="Forms">
  <forms defaultUrl="~/Default.aspx" loginUrl="~/login.aspx" timeout="1440" ></forms>
</authentication>