ASP.NET 4.0 how to set a page as default page

Discussion in 'ASP.NET / ASP.NET Core' started by Pranay, Oct 27, 2010.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. when I enter my website address, I am redirected to my login page instead of my homepage, now I put the home page address in webconfig file in the defaultpage tag in forms authentication block but not working, In default documents setting I gave my homepage highest priorty but no use.
    Please help
    Thanks
     
  2. mjp

    mjp

    What are the names of your login and index files?
    What is the order you specified in default documents?
     
  3. Login file name is Login.aspx which is in Account folder. I dont have an index file here.........can that be issue ???
    well I removed everything now and only default.aspx is there in my default documents
    my scenario:
    When I put my address as www.website.com I should be redirected to Default.aspx page of my website instead
    http://www.website.com/Account/Login.aspx?ReturnUrl=/.... this is what I get.
    I gave permission to Default page for everyone , in IIS default documents, its on the list, in authenticaiton block of webconfig I have defaultUrl as my default page. I still cant fix this thing. I am banging my head right now.
    Please help me
     
  4. mjp

    mjp

    There's a couple of things to check. First, if login is above default in the the default document list, login will be the default document. The order they are listed in determines which will be default if both are present. So, this:
    login.aspx
    default.aspx​
    is no good. It will make login.aspx the default document.

    This is what you want:
    default.aspx
    login.aspx​
    Also, those filenames are case-sensitive. So Default.aspx is not the same thing as default.aspx.
     
  5. the file names are not case-sensitive. I checked it, both locally and as well as on discountasp.net iis tool. Please let me know if I am wrong but I guess file names are not case sensitive. Still banging my head with that problem.
    Its working fine locally, exactly the way it should but for some reason on discountasp.net server it just pops up the login page instead of my home page. Login is not even in index list. I have just my homepage there.
    Anymore suggestions.
    Thanks
     
  6. mjp

    mjp

    If login isn't in your default document list, then it would seem that something is redirecting to login.aspx. Do you still have defaultpage in your web.config, or did you remove it?

    The server wouldn't send a request for domain.com to domain.com/login.aspx unless login.aspx was the default, or there was a redirect in place.
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page