Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to set start page in webconfig file in asp.net c#

How to set start page using Web.config file. I have tried this code

<system.webServer>         <defaultDocument enabled="true">             <files>                 <clear />                 <add value="index.aspx"/>             </files>         </defaultDocument>     </system.webServer> 

But it did not work for me. I have set start page by right click on page in solution explorer then choose option set as start page but how can I do it programmatically?

like image 219
Bhupinder Avatar asked Dec 04 '13 05:12

Bhupinder


People also ask

How do I set the default page in aspx?

Select Admin Tools --> IIS Manager --> Select your website from the list. Click on Default Document on the right hand side and Click Add . Move the entry to the top of the list using the arrows. You are done.

How do I change the startup page in Visual Studio?

To change the startup itemOn the menu bar, choose Tools > Options. Expand Environment, and then choose Startup.


1 Answers

The following code worked fine for me. Kindly check other setting in your Web.config

 <system.webServer>      <defaultDocument>             <files>                 <clear />                                <add value="Login.aspx"/>             </files>         </defaultDocument>     </system.webServer> 
like image 80
user1719554 Avatar answered Sep 28 '22 01:09

user1719554