0
votes

I am working on a ASP.Net 4.5 website which has two sections: unauthenticated and authenticated. Authenticated pages are placed into /secure/ folder.

I have LoginStatus on the masterpage.

<asp:LoginStatus ID="LoginStatus1" runat="server" OnLoggedOut="LoginStatus1_LoggedOut" />

Web.config:

<forms name="Recycle_Auth" loginUrl="~/Login.aspx" defaultUrl="~/secure/Dashboard.aspx" timeout="30" />

The problem I have if I am on localhost and click "Login", it postbacks, but does not redirect to Login.aspx. However if I go to localhost/home.aspx or any other page and click "Login", it works fine.

I tried loginUrl="Login.aspx" without luck. Elmah doesn't log any errors either.

Any ideas would be appreciated.

2

2 Answers

0
votes

My fist guess please check the path attribute ( in web.config under authentication mode)

and regarding Elmah, pleae make sure you put it under system.webServer

<system.webServer>
  <modules>
      <add name="Elmah.ErrorLog" type="Elmah.ErrorLogModule, Elmah" preCondition="managedHandler" />
  </modules>
...
0
votes

Couldn't find the reason, so solved by adding redirect rule in web.config

            <rule name="Redirect Blank URL" stopProcessing="true">
                <match url="^$" />
                <action type="Redirect" url="Home" appendQueryString="false" />
            </rule>