public static GetWebApplicationSection ( string sectionName ) : object | ||
sectionName | string | |
return | object |
public static object GetWebApplicationSection (string sectionName)
{
HttpContext ctx = HttpContext.Current;
HttpRequest req = ctx != null ? ctx.Request : null;
string applicationPath = req != null ? req.ApplicationPath : null;
return GetSection (sectionName, String.IsNullOrEmpty (applicationPath) ? String.Empty : applicationPath);
}
private static void EnsureSectionLoaded() { if (!s_sectionLoaded) { ScriptingScriptResourceHandlerSection section = (ScriptingScriptResourceHandlerSection) WebConfigurationManager.GetWebApplicationSection("system.web.extensions/scripting/scriptResourceHandler"); if (section != null) { s_enableCaching = section.EnableCaching; s_enableCompression = section.EnableCompression; } else { s_enableCaching = (bool)_propEnableCaching.DefaultValue; s_enableCompression = (bool)_propEnableCompression.DefaultValue; } s_sectionLoaded = true; } }