Click here to Skip to main content
15,881,803 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm working with a Web.config file and running on iis 7 using asp.net 3.5.
I was wondering if there is a way to keep a list of default documents in a separate file.

for instance instead of this:
XML
<defaultDocument>
     <files>

       <remove value="Default.htm" />
       <add value="portalmain.aspx" />

     </files>
</defaultDocument>

We read the values from another config file:
XML
<defaultDocument>
     <files configSource="WebDefaultDocuments.config"/>
</defaultDocument>


Thanks
Posted
Updated 28-Sep-12 11:17am
v2
Comments
andy400 28-Sep-12 17:36pm    
Ok thanks, I was looking into a way to read default document from an external config file but I'm not sure I can do that inside system.webserver
fjdiewornncalwe 28-Sep-12 22:27pm    
I'm curious, why would you want to?

1 solution

AFAIK, it cannot be done.

File is just an element without any attributes defined as per documentation.
Refer details here: MSDN: defaultDocument Element [IIS Settings Schema][^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900