Click here to Skip to main content
15,887,485 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi all,
I'm developing a asp.net c# web application.
Basically, my login page is default.aspx, which is in root of the application.
I've set to run in iis, where the url will be http://127.0.0.1/WebSite1

My problem is if i run from any web browser with the url http://127.0.0.1/WebSite1/ my web application takes some time to load the default.aspx (which is the login page). It takes about 1-3 minutes to load the default.aspx page.

But, if i run with the url http://127.0.0.1/WebSite1/default.aspx, it loads fast without any issue.

Even if i run from my visual studio still getting the same issue.

What I have tried:

I've tried below on web.config ;
Attempt 1:
<authentication mode="Forms">
      <forms name=".ASPXAUTH" loginUrl="/default.aspx" />
    </authentication>
      <authorization>
        <deny users="?"/>
      </authorization>


Attempt 2:
<location path="default.aspx">
    <system.web>
      <authorization>
        <allow users="*" />
      </authorization>
    </system.web>
  </location>



On my default.aspx.cs ;
protected void Page_Load(object sender, EventArgs e)
    {
if (Request.IsAuthenticated)
        {
            Response.Redirect("~/Main.aspx");
        }
}



Anything i missed here?
Posted
Updated 2-Jan-18 5:17am

1 solution

In IIS, set the default.aspx page as your default page run. So when you will ask for http://127.0.0.1/WebSite1 this url, it will automatically open the url as -

http://127.0.0.1/WebSite1/default.aspx
 
Share this answer
 
Comments
pwtc222 2-Jan-18 19:44pm    
default.aspx had been added as default document list, still no effect

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900