Re: AjaxUploader Upload button not firing correctly

  •  03-17-2008, 5:30 PM

    Re: AjaxUploader Upload button not firing correctly

    Right, I created a new page within my existing application called AjaxUploader.aspx and copied that code in, I still get the exact same issue, Internet Explorer has JavaScript errors and FireFox doesn't render the browse button on the initial partial page reload. 
    I thought it must be something to do with my references (as I have had to reference CuteWebUI.AjaxUploader.dll so that I can reference it in m code behind) or web.config configuration.  I deleted all references and re-copied the CuteWebUI.AjaxUploader.dll and
    double checked my web.config settings, then I remembered that IIS 7.0 had forced me to run the APPCMD.exe command line to migrate my web.config so the application is compatible with the application pool Integrated .NET mode, see below for a summary of the HTTP 500.0 error
    I received (remember this is Vista, IIS 7.0, Visual Studio 2008, .NET 3.5 environment)

    "Description: This application is running in an application pool that uses the Integrated .NET mode. This is the preferred mode for running ASP.NET applications on the current and future version of IIS.

    In this mode, the application should not specify ASP.NET module components in the <system.web>/<httpModules> configuration section. Instead, it should use the <system.webServer>/<modules> configuration section to load ASP.NET module components. You have the following options:
    1) Migrate the application to work with the Integrated .NET mode (PREFERRED).
    You can migrate the application configuration, including the contents of the <httpModules> configuration section, by using the following from a command line window (the window must be running as Administrator):

    %systemroot%\system32\inetsrv\APPCMD.EXE migrate config "UploaderTest/"

    After you migrate your application, it will run in both Classic and Integrated .NET modes, as well as on downlevel platforms."

    I then had a thought and changed my web application properties to "Use Visual Studio Development server" instead of IIS and low and behold the issues were resolved.  So it looks like it's an out the box incompatibility with my particular environment, primarily the IIS 7.0
    configuration.  I switched my web application properties back to use IIS and investigated.  I created a new "Integrated" managed pipeline application pool and still got the same error, however switching the managed pipeline to "Classic" resolved the issue and solved all the issues,
    however MS suggest against this option as the rest of the error message received earlier states:

    "2) Move this application to an application pool using the Classic .NET mode.
    You can move the application to the default application pool using the Classic .NET mode by running the following from an command line window (the window must be running as Administrator):

    %systemroot%\system32\inetsrv\APPCMD.EXE set app "UploaderTest/" /applicationPool:"Classic .NET AppPool"

    Alternatively, you can use any other application pool on your system that is running in the Classic .NET mode. You can also use the IIS Administration tool to move this application to another application pool.

    It is preferred that you migrate this application by using option 1 to take advantage of the benefits provided by the Integrated .NET mode.

    Error Code: 0x80070032 "

    With a bit of Googling and a crash course in IIS 7.0 Modules and Handlers I found the solution that solves the problems I was experiencing while still allowing the suggested "Integrated" managed pipeline application pool.
    When I ran the command within option 1 of the HTTP 500.0 error above i.e.
    %systemroot%\system32\inetsrv\APPCMD.EXE migrate config "UploaderTest/" the following was added to my web.config file under <system.webServer><modules> <add name="CuteWebUI.UploadModule" type="CuteWebUI.UploadModule,CuteWebUI.AjaxUploader" preCondition="managedHandler"/>
    removing the preCondition="managedHandler" attribute and reloading the page soleved the Firefox and IE issues, for those still interested I found the information that gave me the solution here http://blogs.msdn.com/tmarq/rss.xml

    "For modules, if you set preCondition=”managedHandler” in the <module> entry, the module will only run for managed requests (a managed request is a request that has a managed handler).  If you omit this, the module will run for all requests.  Managed modules in the <modules> section are only called if you're running in the integrated pipeline.  If you're running in classic mode, then <httpModules> is used."

    I hope this helps others out as it seems to be an issue with the APPCMD.EXE tool assuming you have a managed handler for all modules.

    ll
View Complete Thread