ASP.NET Devexpress控件无法在实时服务器上正确显示

时间:2011-03-09 11:17:04

标签: asp.net iis devexpress iis-7.5

在Visual Studio.NET 2010 / localhost上,使用Devexpress编辑器和文本框控件开发的ASP.NET页面看起来不错。上传到IIS 7.5时,生成的html源几乎完全相同,除了对脚本WebResources的引用(脚本src =“/ WebResource.axd?d = tpzArdJXo7erNNqm ...),但验证器不会触发,控件具有不同的风格。

在DevExpress网站的某个地方,我读到WebResources可能由于某种原因而无法访问,并且应该停止IIS服务,清除Temporary ASP.NET文件和GAC缓存,然后重新启动。重新启动IIS是不可能的,我拒绝相信这是唯一的解决方案。

有什么建议吗?

我正在使用DevExpress版本10.1.7.0。这是web.config:

<?xml version="1.0"?>
    <configuration>
        <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>
            <!-- Use semi-colons to separate entries-->
            <add key="ExcludeFromErrorMails" value="Der Thread wurde abgebrochen;Datei ist nicht vorhanden;This is an invalid webresource request'"/>
            <add key="CuteWebUI.AjaxUploader.UseAspNetStream" value="True"/>
        </appSettings>
        <connectionStrings>
    ...
     </connectionStrings>
        <system.web>
            <urlMappings enabled="true">
                <add url="~/QAAwards.aspx" mappedUrl="~/FAQ/QAAwards.aspx"/>
            </urlMappings>
            <customErrors mode="Off"/>
            <httpRuntime executionTimeout="1800" maxRequestLength="50000"/>
            <compilation debug="true">
                <assemblies>
                    <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.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                    <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                    <add assembly="System.Data.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                    <add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                    <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
                    <add assembly="DevExpress.Web.ASPxHtmlEditor.v10.1, Version=10.1.7.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A"/>
                    <add assembly="DevExpress.Web.v10.1, Version=10.1.7.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A"/>
                    <add assembly="DevExpress.Web.ASPxEditors.v10.1, Version=10.1.7.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A"/>
                    <add assembly="DevExpress.Web.ASPxSpellChecker.v10.1, Version=10.1.7.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A"/>
                    <add assembly="DevExpress.Data.v10.1, Version=10.1.7.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A"/>
                    <add assembly="DevExpress.XtraSpellChecker.v10.1.Core, Version=10.1.7.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A"/></assemblies>
            </compilation>
            <authentication mode="Windows"/>
            <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"/>
                    <add namespace="CuteWebUI" assembly="CuteWebUI.AjaxUploader" tagPrefix="CuteWebUI"/>
                    <add namespace="MagicAjax.UI.Controls" assembly="MagicAjax" tagPrefix="MagicAjax"/>
                </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" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
            </httpHandlers>
            <httpModules>
                <add name="MagicAjax" type="MagicAjax.MagicAjaxModule, MagicAjax"/>
                <add name="CuteWebUI.UploadModule" type="CuteWebUI.UploadModule,CuteWebUI.AjaxUploader"/>
                <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            </httpModules>
        </system.web>
        <system.codedom>
            <compilers>
                <compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
                    <providerOption name="CompilerVersion" value="v3.5"/>
                    <providerOption name="WarnAsError" value="false"/>
                </compiler>
                <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" warningLevel="4" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
                    <providerOption name="CompilerVersion" value="v3.5"/>
                    <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="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" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" 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>

1 个答案:

答案 0 :(得分:1)

请在Web应用程序的IIS设置中打开Handler Mappings属性并确定

AssemblyResourceLoader-Integrated和AssemblyResourceLoader-Integrated 4.0的请求路径等于WebResource.axd 和 Type是System.Web.Handlers.AssemblyResourceLoader。

另外,请确保应用程序池的管道模式设置为集成模式。

Olaf,您的web.config文件不包含有关http handler的注册信息。要注册ASPxHttpHandlerModule并启用其功能,只需在表单上放置一个DevExpress Web控件,或手动将特定代码添加到web.config文件中。有关详细信息,请参阅How to manually register a HttpHandler Module主题。