- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我们有一个带有 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>
以下是管理(虚拟目录)应用程序项目 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://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 或其他控件中使用,则必须正确引用它。
关于asp.net-ajax - HTTP 处理程序在 ~/admin/folder 中的嵌套 Web 应用程序文件夹 : Telerik RadScriptManager cannot find WebResource. axd 中找不到 axd 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7491924/
我发现对 WebResource.axd 的一个特定 Web 应用程序请求返回一个完全空白的页面。 (将链接复制并粘贴到新的浏览器窗口中会生成一个完全空的响应文档) IIS 日志显示对 WebReso
问题很简单:如何在 asp.net 应用程序中使用嵌入式资源?在程序集中包含资源的步骤是什么?如何引用它?可能会遇到哪些陷阱? 最佳答案 编辑:对于没有引用 Page 和 ClientScript 的
我有一个大型 .NET 2 Web 应用程序,它已更新为面向 .NET 4.0 框架。自更新以来,我发现我的日志中经常出现以下错误: This is an invalid webresource re
我时不时地在我的生产网站上发现这个问题,这让我非常困惑...... 我的应用程序在开发和生产中都能完美运行,但我时不时会收到一封来自全局错误处理的电子邮件,内容如下: 消息:这是一个无效的网络资源请求
我正在从事一个项目,我正在使用 ii7 中的 url rewite 模块实现一个友好的 url 系统。 一切都很好,效果很好。 我唯一的问题是 webresources.axd 和 Telerik.W
我需要使用 java test 向此其余函数发送 post 请求: @RequestMapping(value = "/upload", method = RequestMethod.POST) pu
在我们的内网环境中,网站运行良好,没有出现任何问题。从外部访问相同的地址,WebResource.axd 返回的末尾有以下结果: /* START */ /* Skipped loading 15
我有一个自定义控件,里面有一个网络资源。 webresource 是一个 javascript 文件,我将 javascript 文件上的构建选项设置为“嵌入式资源”,我的自定义控件所在的项目的 As
第一次来这里。我希望这个问题是有道理的: 我们有一个通用控件库,我正在尝试将其中的嵌入资源用于图像、JS 和 CSS。似乎每次部署到 TEST/PROD 时,都有一个 WebResource.axd
我正在寻找文件 WebResource.axd (查看其源代码)但我找不到它。 它在哪里? 最佳答案 .axd 文件通常作为 HTTP 处理程序实现。它们不作为 ASP.NET 网页存在,而是作为实现
这里是新手。我有一个如下所示的 REST 服务: @GET @PATH("/{id}/headerinfo") @Produces({ JSON, XML}) public Response getR
使用 WebResource.axd 时,您会看到在查询字符串中传递了两个参数。通常看起来像这样: WebResource.axd?d=9H3mkymBtDwEocEoKm-S4A2&t=634093
我是一个 crm 新手,所以请原谅我的误解或意外。 我正在尝试像这样使用 OrganizationServiceproxy 以编程方式创建早期绑定(bind)的网络资源(准确地说是 javascrip
我正在使用 maven-war-plugin 来过滤 WEB-INF 中的一些资源。主要是静态的东西,比如: var url = ${contextRoot}/save.json; 或 一切都很棒。
我在 ASP.NET Webform 元素中使用 WebResource 加载 .css 文件时遇到问题。该元素指的是 sharedProject 文件夹。元素中的每个页面都继承自 sharedPro
我在使用 blowery web 和 WebResource.axd 时遇到了麻烦。 什么是 WebResource.axd? 最佳答案 WebResource.axd 提供对项目内嵌入资源的访问。它
我正在处理创建 Jersey 客户端的任务。我正在使用 Jersey 1.18。目标 URL 如下所示。 https://api.test.com/test/{id}?param1=test1&par
我无法在我的网站上加载脚本文件。其他一切正常。但是,我还没有尝试过 ScriptResource.axd。 我已经验证了这个问题在 cassini 和 IIS7 上都存在。 我已经验证了我的 64 位
将 javascript 文件标记为“嵌入式资源” 向我的 AssemblyInfo 类添加了 WebResource 属性 现在我试图将嵌入的 javascript 输出到我的母版页。我得到的只是来
我从网络场中的一台 ASP 服务器收到大量错误警报,并且所有服务器的 web.config 文件中都具有相同的计算 secret 钥。我环顾四周,但没有找到这个确切案例的答案。欢迎任何建议。 感谢您考
我是一名优秀的程序员,十分优秀!