HTTP 处理程序在嵌套 Web 应用程序文件夹中找不到 axd 文件:Telerik RadScriptManager 在 ~/admin/ 文件夹中找不到 WebResource.axd

2024-01-04

我们有一个带有 2 个 web.config 文件的 Web 应用程序。我在 ASP.NET 页面中使用 telerik:RadScriptManager 控件。该控件需要访问其 ScriptReferences 的 Web 资源文件 (WebResource.axd)。我认为这个 .axd 文件包含 Telerik 控件的 JavaScript 文件。我们所有的 Rad 控件都是在名为“admin”的单独 Web 应用程序 (.csproj) 项目中实现的。根 Web 应用程序项目 (.csproj) 有一个名为“admin”的文件夹,其中包含所有管理项目文件,包括管理 web.config。我在这里遇到问题的页面也存在于管理项目中。我认为它试图访问根文件夹中的 .axd 文件,而不是“/admin”文件夹。 (在更改 HTTP 处理程序的路径后,问题底部出现另一个错误)。如何使应用程序读取 ~/admin/Telerik.Web.UI.WebResource.axd 中的 WebResource.axd 文件而不是 ~/Telerik.Web.UI.WebResource.axd ?我猜测这 3 个 JavaScript 错误是由于此资源问题而导致的,因为当我显式导航到管理文件夹 URL 中的资源时,我可以看到 ASP.NET AJAX Control Toolkit JavaScript 代码。

源代码:

   <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
       <%--<Scripts>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
       </Scripts>--%>
   </telerik:RadScriptManager>

根应用程序 web.config 中的代码:

<location path="Telerik.Web.UI.WebResource.axd">
  <system.web>
    <authorization>
      <allow users="*"/>
    </authorization>
  </system.web>
</location>

以下是网站(根)应用程序项目 web.config HTTP 处理程序:

    <httpHandlers>
        <add path="/services/social.axd" verb="GET,POST" type="Acu.Cms.Modules.Social.PeopleHandler, Acu.Cms.Modules.Social"/>
        <add verb="*" path="AcuLanapCaptcha.axd" type="Lanap.BotDetect.AcuCaptchaHandler, Lanap.BotDetect"/>
        <add verb="*" path="LanapCaptcha.aspx" type="Lanap.BotDetect.CaptchaHandler, Lanap.BotDetect"/>
        <add path="*.cmsx" verb="*" type="Acu.Cms.Web.HttpCmsRequestHandler, Acu.Cms"/>
        <add path="image.acux" verb="GET" type="Acu.Web.Imaging.WebImageHandler, Acu.Web.Imaging"/>
        <add path="media.acux" verb="GET" type="Acu.Cms.Web.CmsWebMediaHandler, Acu.Cms"/>
        <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" />
        <add path="WebResource.axd" verb="GET" type="System.Web.Handlers.AssemblyResourceLoader" validate="true" />
    </httpHandlers>

以下是 admin(虚拟目录)应用程序项目 web.config HTTP 处理程序:

  <httpHandlers>
        <remove path="LanapCaptcha.aspx" verb="*" />
        <remove path="AcuLanapCaptcha.aspx" verb="*" />
        <remove verb="*" path="*.asmx" />
        <add path="Authenticator.ashx" verb="GET,POST" type="Acu.Cms.Website.Admin.Authenticator, Acu.Cms.Website.Admin" />
        <add verb="*" path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler" validate="false" />
        <add verb="*" path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.Upload.RadUploadProgressHandler, Telerik.Web.UI" />
        <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="*" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" validate="false" />
        <!--ScriptResourceHandler.axd is the resource handler URL used to serve all of the javascript files found in the Microsoft AJAX Library-->
        <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" />
        <add path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler" verb="*" validate="false" />
        <add path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" verb="*" validate="false" />
        <add path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler" verb="*" validate="false" />
        <add verb="*" validate="false" path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler, Telerik.Web.UI" />
    </httpHandlers>

JavaScript 错误#1:

ASP.NET Ajax 客户端框架无法加载。

<script type="text/javascript">
//<![CDATA[
if (typeof(Sys) === 'undefined') throw new Error('ASP.NET Ajax client-side framework failed to load.');
function WebForm_OnSubmit() {
if (typeof(ValidatorOnSubmit) == "function" && ValidatorOnSubmit() == false) return false;
return true;
} 

JavaScript 错误#2:

系统未定义

<script type="text/javascript">
//<![CDATA[
Sys.WebForms.PageRequestManager._initialize('RadScriptManager1', document.getElementById('editorform'));
Sys.WebForms.PageRequestManager.getInstance()._updateControls(['tctl00SU'], [], [], 90);
//]]>
</script> 

JavaScript 错误#3:

RadEditorCommandList 未定义

RadEditorCommandList['Edit Link'] = function(commandName, editor, oTool)
{
_editor = editor;
_point = editor.CreateRestorePoint();
var selection = editor.GetSelection();
var pe = selection.GetParentElement();
var id = '';
if (pe && pe.tagName.toLowerCase() == 'a' && pe.attributes['cms:asset_id']) {
id = pe.attributes['cms:asset_id'].value;
}
window.top.InlineLinkEditor.selection = selection.GetText();
window.top.InlineLinkEditor.show('elementid=' + $('__elementId').value + '&xrefid=' + id + '&html=' + encodeURIComponent(selection.GetHtmlText()), editLink, null);
}; 

===========

解决更多问题...

我尝试将管理项目 web.config WebResource HTTP 处理程序的路径更改为“/admin/...”,但随后出现以下新错误。

<add verb="*" path="/admin/Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" validate="false" />

新错误:

Server Error in '/' Application.
'~/Telerik.Web.UI.WebResource.axd' is missing in web.config. RadScriptManager requires a HttpHandler registration in web.config. Please, use the control Smart Tag to add the handler automatically, or see the help for more information: Controls > RadScriptManager
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: '~/Telerik.Web.UI.WebResource.axd' is missing in web.config. RadScriptManager requires a HttpHandler registration in web.config. Please, use the control Smart Tag to add the handler automatically, or see the help for more information: Controls > RadScriptManager

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[InvalidOperationException: '~/Telerik.Web.UI.WebResource.axd' is missing in web.config. RadScriptManager requires a HttpHandler registration in web.config. Please, use the control Smart Tag to add the handler automatically, or see the help for more information: Controls > RadScriptManager]
   Telerik.Web.UI.RadScriptManager.OnPreRender(EventArgs e) +169
   System.Web.UI.Control.PreRenderRecursiveInternal() +80
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +842


Version Information: Microsoft .NET Framework Version:2.0.50727.3623; ASP.NET Version:2.0.50727.3618 

试图从这篇文章中获取一些信息:

http://weblogs.asp.net/asptest/archive/2008/10/06/asp-net-ajax-and-http-handlers-a-cautionary-tale.aspx http://weblogs.asp.net/asptest/archive/2008/10/06/asp-net-ajax-and-http-handlers-a-cautionary-tale.aspx

还尝试使用它来解决问题..它帮助指导了我一点,但对于我的特定问题来说并不完整:

http://www.telerik.com/help/aspnet-ajax/introduction-troubleshooting.html http://www.telerik.com/help/aspnet-ajax/introduction-troubleshooting.html


事实证明,ASP.NET 首先查看根 web.config 中的 HTTP 处理程序,然后查看虚拟目录 web.config 文件中的 HTTP 处理程序。因此,当它到达下面我标记为“罪魁祸首”的行时,它从未到达虚拟目录 web.config 文件中的行。所以我只是在“罪魁祸首”HTTP 处理程序上方添加了另一行。

网站根文件夹 web.config HTTP 处理程序:

<httpHandlers>
    <add path="/services/social.axd" verb="GET,POST" type="Acu.Cms.Modules.Social.PeopleHandler, Acu.Cms.Modules.Social"/>
    <add verb="*" path="AcuLanapCaptcha.axd" type="Lanap.BotDetect.AcuCaptchaHandler, Lanap.BotDetect"/>
    <add verb="*" path="LanapCaptcha.aspx" type="Lanap.BotDetect.CaptchaHandler, Lanap.BotDetect"/>
    <add path="*.cmsx" verb="*" type="Acu.Cms.Web.HttpCmsRequestHandler, Acu.Cms"/>
    <add path="image.acux" verb="GET" type="Acu.Web.Imaging.WebImageHandler, Acu.Web.Imaging"/>
    <add path="media.acux" verb="GET" type="Acu.Cms.Web.CmsWebMediaHandler, Acu.Cms"/>
    <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" />
    <!-- FIXED WITH THIS LINE --><add verb="*" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" validate="false" />  
    <!-- CULPRIT ............ --><add path="WebResource.axd" verb="GET" type="System.Web.Handlers.AssemblyResourceLoader" validate="true" />  
</httpHandlers>

还将其添加到虚拟目录 web.config 中:

    <handlers>

...删除了其他处理程序

        <add name="Telerik.Web.UI.WebResource"
             path="Telerik.Web.UI.WebResource.axd" 
             type="Telerik.Web.UI.WebResource, Telerik.Web.UI"
             verb="*"  />

    </handlers>

...另一种选择是将“admin/*”添加到路径 web.config 属性的开头。如果该处理程序在 RadEditor 或其他控件中使用,则必须正确引用它。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

HTTP 处理程序在嵌套 Web 应用程序文件夹中找不到 axd 文件:Telerik RadScriptManager 在 ~/admin/ 文件夹中找不到 WebResource.axd 的相关文章

  • 如何防止.exe类型文件在网站上传?

    假设我们有一个 example exe 文件 我们首先将该文件放入一个新文件夹中 然后使用任何压缩软件压缩该文件夹 我们可以阻止压缩文件夹在网站中上传吗 我们怎样才能做到这一点 你不能prevent它 因为在提交之前你无法知道浏览器将要提交
  • 在同一服务器上部署 ASP.net Ajax 1.0 和 3.5 Web 应用程序

    我们有一个生产服务器 其中运行 Ajax 1 0 的 ASP net 2 0 应用程序和相应的工具包 工具包版本 1 0 20229 我被要求使用 ASP net 3 5 移动另一个应用程序构建 该应用程序也利用了最新的 ASP NET A
  • 尝试使用 Ajax 调用控制器方法 MVC 获取数据 我的代码附

    我在下拉值更改上调用 jquery 函数 jquery 方法是 function MyFunction alert DDlSurvey val ajax url Url Action GetSelectedQuestion ConductS
  • 如何在 KeyUp 上进行文本框回发?

    我有一个文本框 可以更改 OnTextChanged 事件中下拉列表的内容 当文本框失去焦点时 此事件似乎会触发 如何在按键或按键事件上实现此操作 这是我的代码的示例
  • 如何将 ASP.NET 隐藏字段值分配给 JavaScript 变量?

    以下是摘自的代码片段http pietschsoft com post 2011 09 09 Tag Editor Field using jQuery similar to StackOverflow aspx http pietschs
  • 特定组件的自定义样式应用于 Angular 6 中的所有组件

    ui 网格 我试图将自定义样式应用于特定组件 我想更改该特定组件的字体大小 但是当我在该特定组件 css 文件中编写 css 代码时 并且在加载该组件后 该样式将应用到所有其他组件也 以下是css文件中的代码 k grid td font
  • 更改 UpdatePanel 外部 TextBox 中的文本

    我在 UpdatePanel 中有一个 gridview gridview 显示在弹出窗口中 单击该网格中的选择按钮后 我尝试在页面中设置文本框文本 但它不起作用 如果我删除更新面板那么它就会工作 这是我在 aspx 中的代码 div di
  • 使用 C# (telerik) 在 wpf 中自定义弹出窗口的设计

    我在按钮单击事件中显示一个弹出窗口 gt 我在该弹出窗口中保留了一个自定义用户控件 因此每当显示弹出窗口时 都会显示自定义用户控件 但现在我需要修改自定义控件 弹出窗口中当前的自定义控件如下所示 但我需要角落看起来像下面的图片 如何做到这一
  • asp.net 自定义 HttpHandler 和 URL 路由

    我想通过自定义 HttpHandler 处理对我的应用程序 http example com whateverpath 的请求 但返回的内容取决于 whateverpath 的值 因此 访问 http example com path1 的
  • DataGrid SelectionChanged MVVM [关闭]

    Closed 这个问题需要多问focused help closed questions 目前不接受答案 我刚刚开始使用 WPF 和 MVVM 框架 我有一个带有两个 DataGrid 的窗口 我想根据另一个 DataGrid 的行选择在一
  • 使用 Javascript 将日期设置为 raddatepicker

    我从服务器端获取日期值并将其传递给 javascript 方法 然后使用 Javascript 将日期分配给 Telerik RadDatePicker 控件 我得到的日期为 var Date1 16 01 2013 00 00 00 fu
  • 更新进度动画 gif 在回发时停止

    我使用了 ajax 更新进度控件 在回发发生时显示动画 gif 问题 它显示一段时间 但随后停止刷新 或者更确切地说 停止播放 循环 造成同样情况的实际原因是什么 请指教 谢谢 使用 Internet Explorer 时 gif 的动画将
  • 绑定列需要 ASP.NET MVC 中的字段或属性访问表达式

    我在数据库中有一对多的关系 我使用实体接口来生成2个对象之间的关联 我收到错误 绑定列需要字段或属性访问表达式 My code in view Html Telerik Grid
  • ASP.NET AJAX 4.0 客户端数据绑定

    我在 MSDN 杂志上读到了一些有关 ASP NET AJAX 4 0 新功能的文章 主要是客户端数据绑定 我觉得 MSDN 杂志有时包含很多 营销 所以我对真正开发人员的意见很感兴趣 值得吗 您打算使用它吗 Edit 如果有人感兴趣的话
  • ASP.NET AJAX 进度条:从代码隐藏更新?

    我在应用程序中具有 Excel 电子表格的导入功能 目前它使用 FileUpload 控件 我上传文件 然后对该文件运行操作 我想通知用户正在完成的操作以及完成的百分比 我认为我可以获取从 Excel 电子表格中提取的总行数 并在将每条记录
  • ASP.Net 异步 HTTP 文件上传处理程序

    我正在尝试在 C 中创建一个异步文件上传处理程序 并且可以通过 AJAX 异步请求提供有关文件进度的更新 基本上 如果请求是 POST 它会将一些信息加载到会话中 然后开始上传 如果请求是 GET 它会返回上传的当前状态 上传的字节数 总字
  • 如何将 webmethod 与 telerik 批量编辑网格一起使用

    Work on Asp net vs2012 C telerik RadGrid batch edit I put save button outside from the grid Under the save button want t
  • 更新面板异常处理

    当我在正在构建的 ASP NET Web 应用程序中实现的 UpdatePanel 中发生异常时 它们会导致页面上出现 JavaScript 错误 并在警报中提供一些高级错误输出 这对于开发来说还可以 但是一旦系统投入生产 由于多种原因 这
  • 如何将 Telerik RadGrid 默认设置为编辑模式? (ASP.NET)

    我在 RadGrid 中有一个复选框列 我希望用户能够选中 取消选中它并设置附加属性 但是 当网格呈现时 复选框将被禁用 因为网格不处于 编辑模式 我找到的所有示例都希望我经历一个漫长的过程 选择记录 将其置于编辑模式 更改值 保存值 ya
  • 如何限制ajax日历扩展器中的年份

    我有一个日历延长器 我只想在日历中显示当前年份 用户无法选择 2010 年 因为当前年份是 2011 年 那么如何做到这一点呢 Use the StartDate and EndDate属性来设置您希望允许用户选择的可接受日期范围 您可以根

随机推荐