How to make home page as default page in asp.net

18,886

Change in your webconfig for iis 7.

<system.webServer>
      <defaultDocument>
        <files>
          <clear />
          <add value="CreateThing.aspx" />
        </files>
      </defaultDocument>
    </system.webServer>

Take a look for this post :Set Default Page in Asp.net

Share:
18,886
j4m4l
Author by

j4m4l

Updated on June 04, 2022

Comments

  • j4m4l
    j4m4l almost 2 years

    How can i set default home page in asp web.config file.
    i have already written this code :

    <urlMappings>
      <add url="/" mappedUrl="Home.aspx"/>
      <add url="Default.aspx" mappedUrl="Home.aspx"/>
    </urlMappings>     
    

    and also tried this

    <defaultDocument>
      <files>
        <add value="Home.aspx" />
      </files>
    </defaultDocument>
    

    but i guess its not working. when i type www.example.com it says directory listing is disabled, but does not redirect to www.example/Home.aspx.

    I dont want to enable directory listing but if someone types www.example.com he should be send to www.example.com/Home.aspx

  • j4m4l
    j4m4l about 12 years
    Thi is not working either... may be i am missing something.. please guide me where to look.
  • SMK
    SMK about 12 years
    are you add Default pages name(Home.aspx,Default.aspx...etc) in your hosting server?