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?
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.
To change the startup itemOn the menu bar, choose Tools > Options. Expand Environment, and then choose Startup.
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>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With