Search code examples
asp.netasp.net-mvciis-7axd

404 error when load FineUI axd file on IIS7


I deploy FineUI example project on IIS7, but got 404 error from http network when loading .axd files. Any idea the root cause?


Solution

  • Maybe caused by IIS7 integrated mode.If it is IIS Integrated Mode,You need to add information to system.webServer section:

    <add name="FineUIResAxd" verb="GET" path="res.axd" type="FineUI.ResourceHandler, FineUI”/>
    

    Complete System.WebServer is as follows:

    <system.webServer>
        <modules>
            <add name="FineUIScriptModule" type="FineUI.ScriptModule, FineUI"/>
        </modules>
        <handlers>
            <add name="FineUIResAxd" verb="GET" path="res.axd" type="FineUI.ResourceHandler, FineUI"/>
        </handlers>
    </system.webServer>
    

    If IIS is Classic Mode,need to add httpModules and httpHandlers below system.web section:

    <system.web>
        <pages>
            <controls>
                <add assembly="FineUIPro" namespace="FineUIPro" tagPrefix="f"/>
            </controls>
        </pages>
    
        <httpModules>
            <add name="FineUIProScriptModule" type="FineUIPro.ScriptModule, FineUIPro"/>
        </httpModules>
    
        <httpHandlers>
            <add verb="GET" path="res.axd" type="FineUIPro.ResourceHandler, FineUIPro" validate="false"/>
        </httpHandlers>
    <system.web>
    

    When developing in VS, the default built-in IIS Express server is used. You can easily change IIS Express to Classic or Integrated Mode. 1.Choose project in VS, then click F4. 2.Display properties window, change mode.