Setting Start or Default Page in IIS Server in ASP.Net

gopikshnan
 
on Feb 20, 2013 05:35 AM
6218 Views

Hello,

I have problem with default.aspx setting in global.asax file.When i am running dot net application from solution explorer i can set the default page as start page or when i am running the application the on IIS server i can set that default page as start page through the setting.This thing i want to do in programmatic way using the global.asax file

How can i achieve this ??

Download FREE API for Word, Excel and PDF in ASP.Net: Download
Mudassar
 
on Feb 20, 2013 05:37 AM

If you are using IIS7 then you need to set the following in web.config file

 

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