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

How to customize the default home page in asp web.config

.
I already wrote 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 think it doesn't work. when i type www.example.com

it says the directory listing is disabled but not redirected to www.example/Home.aspx

.

I don't want to include a directory listing, but if someone types www.example.com

it should be sent towww.example.com/Home.aspx

+3


source to share


1 answer


Change your webconfig to iis 7.

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

      



Take a look at this post: Set the default page in Asp.net

+5


source







All Articles