Getting maxRequestLength value

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I am not able to find information on this elsewhere... Is there a way to get the HttpContext attribute maxRequestLength's value programmatically? I know I could load the web.config file as a standard xml doc and parse it that way, but I am looking for a more elegant way of getting the specified value. Also, if it is not specified, I would like to default back to the value specified in machine.config

Thanks for any help with thi

Jim
 
Hi Jim,

As for the problem that programmatically retrieve the configuration setting
in web.config at runtime, I've also searched on the web and there does
exist some similiar questions on this. Currently it seems that the only
workaround is as you mentioned in the original message: read the web.
config file as a normal xml file via XmlDocument. And the only elements
which can be accessed via the
System.Configuration.ConfigurationSettings
is those items in <appSettings> or custom configure areas as described in
the following reference:

#Accessing ASP.NET Configuration Settings
http://msdn.microsoft.com/library/en-us/cpguide/html/cpgrfaccessingaspnetcon
figurationsettings.asp?frame=true

Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
 
Hi Jim,

Have you had a chance to check out the suggestions in my last reply or have
you got any further ideas on this issue? If you have anything unclear or if
there're anything else we can help, please feel free to post here. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
 
Back
Top