0

I am not able to make my ASP.Net login page receive any postback the first time. My solution structure is as follows Root - Login/Login.aspx - UI/Homepage.aspx

When I start my asp.net website from visual studio, it shows the login.aspx page but the URL at the top of the browser says http://app.mysass.com and not http://app.mysass.com/Login/Login.aspx

The funny thing is if I click on the login button on this page, the page reload itself back to http://app.mysass.com. The server side button click is not even hit.

Only when I type in http://app.mysass.com/Login/Login.aspx and then click the login button then btn_click on postback gets fired on the server.

I am guessing this has go something to do with my web.config so here it is.

<configuration>

  <system.web>
    <authentication mode="Forms">
      <forms loginUrl="~/Login/Login.aspx" name=".DEBUG" defaultUrl="~/UI/Homepage.aspx" protection="All" timeout="240" path="/" slidingExpiration="true" cookieless="UseCookies" />
    </authentication>

    <authorization>
      <deny users="?" />
      <allow users="*" />
    </authorization> 
  </system.web>

  <system.webServer>
    <defaultDocument>
      <files>
        <clear />
        <add value="~/UI/Homepage.aspx" />
      </files>
    </defaultDocument>
  </system.webServer>

  <location path="Login" allowOverride="false">
    <system.web>
      <authorization>
        <allow users="*" />
      </authorization>
    </system.web>
  </location>

</configuration>
user1763470
  • 197
  • 1
  • 1
  • 11
  • Does the location of your web.config resolve to app.mysass.com? – Ross Bush May 10 '17 at 18:50
  • Yes, my web.config is my root folder ie in app.mysaas.com. – user1763470 May 11 '17 at 04:18
  • Can you try again this time removing the default document. I don't see why that is needed since it is behind your security. It would just be causing a redirect and will be overwritten by whatever the redirect url is set to prior to authentication. – Ross Bush May 11 '17 at 11:56
  • If I dont have a default document set then when I click on http://app.mysass.com it says HTTP Error 403.14 - Forbidden The Web server is configured to not list the contents of this directory. – user1763470 May 11 '17 at 16:53
  • Hmmm...I would have thought you would have been redirected to the default forms url. – Ross Bush May 11 '17 at 17:08

0 Answers0