Click here to Skip to main content
15,896,557 members

If i Comment Out then AJAX won't work. If I leave it in, the ASP.NET application won't load (it's a sub-application of a root website done up in Classic ASP)

Brian C Hart asked:

Open original thread
How do I work my way around this catch-22? Any suggestions? I've spent a good deal of time Googling for any possible workarounds and some of what I've done is a result of that, but I am still stuck.

See the tags list for this post for my environment. I am testing with IIS7 on Win7 with VS2010 and ASP.NET 4/VB.NET but Classic ASP/VBScript as well.
Basically, I have a main 'mysite.com' and it's a Classic ASP Web Application and at the root.

In a directory '/NAAC/purchase' I have a sub-application using ASP.NET 4/VB.NET developed with VS2010 and using AJAX.

I'm in a bit of a bind. I had to comment out the whole <configSections> element of my web.config (of the root - Classic ASP - website) file in order to get the sites to play nice with each other, but then AJAX stops working because the stuff in the commented out section is necessary for AJAX.

With the stuff commented out, I get "Microsoft JScript runtime error: ASP.NET Ajax client-side framework failed to load." But the index.aspx page of my sub-website loads fine otherwise. Now, let's say I remove the web.config comments and I have:

HTML
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
    &lt;!-- Register a new config section--&gt;
    <configsections>
        <sectiongroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
            <sectiongroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
                <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirepermission="false" allowdefinition="MachineToApplication" />
                <sectiongroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
                    <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirepermission="false" allowdefinition="Everywhere" />
                    <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirepermission="false" allowdefinition="MachineToApplication" />
                    <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirepermission="false" allowdefinition="MachineToApplication" />
                    <section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirepermission="false" allowdefinition="MachineToApplication" />
                </sectiongroup>
            </sectiongroup>
        </sectiongroup>
    </configsections>
    <appsettings>
	proprietary stuff here...
    </appsettings>
    &lt;!-- Connection string, currently configured for SQL Express--&gt;
    <system.web>
        <compilation debug="true" targetframework="4.0">
            <assemblies>
                <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
                <add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
                <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
                <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
                <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
                <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
            </assemblies>
        </compilation>
        <pages>
            <controls>
                <add tagprefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
                <add tagprefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
            </controls>
        </pages>
        <httphandlers>
            <remove verb="*" path="*.asmx" />
            <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
            <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
            <add verb="GET,HEAD" path="ScriptResource.axd" validate="false" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        </httphandlers>
        <httpmodules>
            &lt;!--<remove name="UrlRewriter" />--&gt;
            <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        </httpmodules>
        <identity impersonate="false" />
        <authentication mode="Windows" />
    </system.web>
    <system.codedom>
        <compilers>
            <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CSharp.CSharpCodeProvider,System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warninglevel="4">
                <provideroption name="CompilerVersion" value="v4.0" />
                <provideroption name="WarnAsError" value="false" />
            </compiler>
            <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warninglevel="4">
                <provideroption name="CompilerVersion" value="v4.0" />
                <provideroption name="OptionInfer" value="true" />
                <provideroption name="WarnAsError" value="false" />
            </compiler>
        </compilers>
    </system.codedom>
    <system.webserver>
        <validation validateintegratedmodeconfiguration="false" />
        <modules>
            <remove name="ScriptModule" />
            <add name="ScriptModule" precondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        </modules>
        <handlers>
            <remove name="WebServiceHandlerFactory-Integrated" />
            <remove name="ScriptHandlerFactory" />
            <remove name="ScriptHandlerFactoryAppServices" />
            <remove name="ScriptResource" />
            <add name="PageHandlerFactory-ISAPI-4.0" path="*.aspx" verb="*" modules="IsapiModule" scriptprocessor="C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" resourcetype="Unspecified" precondition="classicMode,runtimeVersionv4.0,bitness32" />
            <add name="ScriptHandlerFactory" verb="*" path="*.asmx" precondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
            <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" precondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
            <add name="ScriptResource" verb="GET,HEAD" path="ScriptResource.axd" precondition="integratedMode" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        </handlers>
    </system.webserver>
    <runtime>
        <assemblybinding xmlns="urn:schemas-microsoft-com:asm.v1">
            <dependentassembly>
                <assemblyidentity name="System.Web.Extensions" publickeytoken="31bf3856ad364e35" />
                <bindingredirect oldversion="1.0.0.0-1.1.0.0" newversion="3.5.0.0" />
            </dependentassembly>
            <dependentassembly>
                <assemblyidentity name="System.Web.Extensions.Design" publickeytoken="31bf3856ad364e35" />
                <bindingredirect oldversion="1.0.0.0-1.1.0.0" newversion="3.5.0.0" />
            </dependentassembly>
        </assemblybinding>
    </runtime>
</configuration>


But now I get "HTTP Error 500.19 - Internal Server Error. The requested page cannot be accessed because the related configuration data for the page is invalid. There is a duplicate 'system.web.extensions/scripting/scriptResourceHandler' section defined."

You see, I commented out the <configSections> element in my Web.config in order to work around this error, but then AJAX won't work even though the rest of the page displays.

How do I work my way around this catch-22? I'd be grateful for any suggestions!
Tags: Visual Basic, VBScript, Windows, Windows 7, ASP, Visual Studio (Visual Studio 2010), IIS 6.0, IIS 7.0, ASP.NET, IIS

Plain Text
ASM
ASP
ASP.NET
BASIC
BAT
C#
C++
COBOL
CoffeeScript
CSS
Dart
dbase
F#
FORTRAN
HTML
Java
Javascript
Kotlin
Lua
MIDL
MSIL
ObjectiveC
Pascal
PERL
PHP
PowerShell
Python
Razor
Ruby
Scala
Shell
SLN
SQL
Swift
T4
Terminal
TypeScript
VB
VBScript
XML
YAML

Preview



When answering a question please:
  1. Read the question carefully.
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  3. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
  4. Don't tell someone to read the manual. Chances are they have and don't get it. Provide an answer or move on to the next question.
Let's work to help developers, not make them feel stupid.
Please note that all posts will be submitted under the http://www.codeproject.com/info/cpol10.aspx.



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