In this short informative article I will explain how to set default page for your website in IIS using Web.Config file in ASP.Net.
This feature is applicable for .Net 3.5, 4.0, 4.5 or above frameworks.
First you need to look for <system.webServer> in your Web.Config file, if it is missing then you will need to add it. After that you need to add the <defaultDocument> section as shown below. And within it between the <files> section you can add either single page or multiple pages.
 
Set default page for your website in IIS using Web.Config file in ASP.Net

Single Default Page
 
<defaultDocument enabled="true">
 <files>
    <clear/>
    <add value="Home.aspx"/>
 </files>
</defaultDocument>
 
Multiple Default Pages
 
Here if the Home.aspx page is missing the 2nd page i.e. Contact.aspx will become the Default page.
 
<defaultDocument enabled="true">
 <files>
    <clear/>
    <add value="Home.aspx"/>
    <add value="Contact.aspx"/>
 </files>
</defaultDocument>
 
Note: Above will not work in Visual Studio Localhost Web Server, thus if you want to set a default page in Visual Studio you need to do as shown in the screenshot below.


Set default page for your website in IIS using Web.Config file in ASP.Net

Downloads