GetWebApplicationSection() public static method

public static GetWebApplicationSection ( string sectionName ) : object
sectionName string
return object
示例#1
0
            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;
                }
            }
示例#2
0
        public object GetConfig(string sectionName)
        {
            object o = WebConfigurationManager.GetWebApplicationSection(sectionName);

            if (o == null || o is IgnoreSection)
            {
                /* this can happen when the section
                 * handler doesn't subclass from
                 * ConfigurationSection.  let's be
                 * nice and try to load it using the
                 * 1.x style routines in case there's
                 * a 1.x section handler registered
                 * for it.
                 */
                object o1 = WebConfigurationManager.oldConfig.GetConfig(sectionName);
                if (o1 != null)
                {
                    return(o1);
                }
            }

            return(o);
        }
示例#3
0
 internal static ScriptingAuthenticationServiceSection GetConfigurationSection()
 {
     return((ScriptingAuthenticationServiceSection)WebConfigurationManager.GetWebApplicationSection("system.web.extensions/scripting/webServices/authenticationService"));
 }