3

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

citronas
  • 19,035
  • 27
  • 96
  • 164
j4m4l
  • 328
  • 2
  • 10
  • 22
  • possible duplicate of [Set Default Page in Asp.net](http://stackoverflow.com/questions/1913058/set-default-page-in-asp-net) – balexandre Apr 06 '12 at 05:42
  • @walther - what do you mean classic asp... are you talking about pipeline mode, will this work if i make it classic asp – j4m4l Apr 07 '12 at 05:35
  • You tagged this question with "classic asp", so I retagged it for you. Classic asp is a completely different thing. Anyway, did you put like suggested? – walther Apr 07 '12 at 07:41

1 Answers1

5

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

Community
  • 1
  • 1
SMK
  • 2,098
  • 2
  • 13
  • 21
  • Thi is not working either... may be i am missing something.. please guide me where to look. – j4m4l Apr 07 '12 at 05:09
  • are you add Default pages name(Home.aspx,Default.aspx...etc) in your hosting server? – SMK Apr 07 '12 at 12:29