Click here to Skip to main content
12,242,812 members (47,462 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: ASP.NET
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:
<defaultDocument>
     <files>
 
       <remove value="Default.htm" />
       <add value="portalmain.aspx" />
 
     </files>
</defaultDocument>
We read the values from another config file:
<defaultDocument>
     <files configSource="WebDefaultDocuments.config"/>
</defaultDocument>

Thanks
Posted 28-Sep-12 12:09pm
andy400450
Edited 28-Sep-12 12:17pm
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
Marcus Kramer 28-Sep-12 22:27pm
   
I'm curious, why would you want to?

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

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][^]
  Permalink  

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160426.1 | Last Updated 28 Sep 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100