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.
views:
636answers:
2
+1
A:
I found the answer at CoderSource.net. I had to put the correct path into my web.config file.
<?xml version="1.0"?>
<configuration>
<system.web>
...
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Forms">
<forms loginUrl="~/FolderName/Login.aspx" />
</authentication>
...
</system.web>
...
</configuration>
Zack Peterson
2008-08-28 18:56:52
What I'm intersted in - is why does this happen in the first place?
Vidar
2008-10-09 09:20:47
I guess that by default Microsoft assumes you'll have a Login.aspx page at the root: http://domain.com/Login.aspx. You have to change the web.config to override that default assumption.
Zack Peterson
2008-10-09 18:32:10
The default value of the `loginUrl` property is indeed `"~/Login.aspx"`.
Christian Hayter
2009-10-22 16:01:20
+6
A:
Use the LoginUrl property for the forms item?
<authentication mode="Forms">
<forms defaultUrl="~/Default.aspx" loginUrl="~/login.aspx" timeout="1440" ></forms>
</authentication>
Aros
2008-08-28 18:59:05