Last post Aug 10, 2007 05:52 PM by rstrahl
Aug 07, 2007 08:04 PM|jijo_robert|LINK
I am creating iis website through c# code. I am able to create the website, however I would like to remove all default documents (default.htm, default.aspx etc.,) and put in a custom page in that list (firstpage.aspx) -- Please let me know how I can do this
Aug 08, 2007 01:07 AM|Svante|LINK
It varies slightly depending on if you're running IIS 5, IIS 6 or IIS 7. It would make it much too easy if configuration options stayed in the same place between versions. Go to administrative tools, select Internet Information Server. In IIS 7, select the
web server or virtual directory in question, and then choose "Default Document" in the right hand pane. For IIS 5 and 6 it's part of the properties tabs if I recall correctly.
Aug 10, 2007 05:52 PM|rstrahl|LINK
You can use directory services to do this in code although it may not work from your Web application because of permissions issues.
Here's some code that creates or opens a virtual and sets properties the virtual directory. Notice the DefaultDoc towards the bottom of the code:
Hope this helps,
+++ Rick ---