ASP.NET AXD resources getting blocked at client side?

 ̄綄美尐妖づ 提交于 2019-12-23 12:00:30

问题


I have a web application that I am hosting, and a client of mine is reporting that certain Telerik javascript libraries that are included within the site (but not all of them) are not working properly.

What I was able to diagnose so far was that at some point at the process, the WebResource.axd resources that contain the Telerik javascript code are getting blocked. Asking the client to navigate directly to the AXD file itself with the same querystring is yielding a "The connection to the server was reset" error message in Internet Explorer.

The client has tried downloading that file from several machines at their location, as well as a machine outside of their firewall and network, and a machine running at their home, and gets the same error each time. They have tried using both Internet Explorer and Firefox.

However, I am able to successfully download the same file both inside our hosting network, outside of it, and from my home connection.

According to the IIS logs, all logged attempts to download the resource yielded a 200 HTTP OK result.

Other things that have been attempted:

  • A link to a nonexistant 404.axd (gave the yellow ASP.NET 404 error message as expected)
  • A link to WebResource.axd, but with an invalid querystring pointing to a resource that does not exist (gave the yellow ASP.NET invalid viewstate or invalid base64 string, as expected)
  • A link to the same WebResource.axd, but via a different host header (same "connection reset" error message).

I'm at a loss now for what could even possibly be the problem at this point. Our hosting server has been hosting dozens of different ASP.NET applications (including several instances of the one in question) for years and this is the first complaint I've seen regarding this.

I'm 99% sure that the issue is something on the client's end with an improper firewall or router content filtering configuration, but that doesn't explain why the client is seeing the same issues both outside the firewall and at home.

Any ideas as to what could be going wrong or even what further questions to ask? Has anyone seen anything even remotely like this?


回答1:


If this is happening with the classic RadControls for ASP.NET, try setting UseEmbeddedScripts="false" for the controls on the page. This will make them serve all scripts from the RadControls folder (physical .js files) instead of using embedded resources (WebResource.axd). Naturally, you have to make sure that you have the script files in your RadControls folder.

If this is happening with the RadControls for ASP.NET AJAX, then the controls scripts are downloaded using the script manager (ScriptResource.axd and not WebResource.axd). In any case, you can try using the Telerik RadScriptManager instead of the ASP.NET ScriptManager -this will combine and compress all scripts into one request.

Finally, you can ask your customer to download and install Fiddler for IE or Firebug for Firefox and check what exactly is happening with the requests that fail (e.g. server response, what is in the response body, etc.).




回答2:


Never did figure out what the issue was, but updating the RadControls to the latest (Q1'09 final) seemed to resolve the issue.




回答3:


To eliminate WebResource.axd and ScriptResource.axd from the page, you need to

  • Open the related assmbly using the Reflector or ILSpy and then save its embedded JS files from the resources section.
  • Now add them as the Script References using asp:ScriptManager

Later these definitions will be rendered as:

<script src="staticJS1.js" type="text/javascript"></script> 
<script src="staticJS2.js" type="text/javascript"></script> 

And won't be blocked anymore.

<asp:ScriptManager ID="Scriptmanager1" runat="server">
        <Scripts>
            <asp:ScriptReference Name="MicrosoftAjaxWebForms.js" Assembly="System.Web.Extensions"
                Path="~/staticJS1.js" />
            <asp:ScriptReference Name="MicrosoftAjax.js" Assembly="System.Web.Extensions" Path="~/staticJS2.js" />
        </Scripts>
</asp:ScriptManager>


来源:https://stackoverflow.com/questions/2364442/asp-net-axd-resources-getting-blocked-at-client-side

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!