ScriptResources Error : This is an invalid script resource request

后端 未结 2 1418
一生所求
一生所求 2020-12-25 14:40

We catch this error sporadically. Does anyone know what could it be?

The URL give by our error logging get this weird url for this error :

ht

相关标签:
2条回答
  • 2020-12-25 15:09

    You may be using AJAX. ScriptResource.axd is a handler meant to serve your scripts that are in turn stored inside your assembly.

    http://forums.asp.net/t/1258715.aspx

    The URL isn't weird if you think about it. It has two parameters d and t. Can you reproduce this error at will?

    0 讨论(0)
  • 2020-12-25 15:13

    I get this error quite often, doing some research I have found the following.

    1. If you have a web farm your machine keys might not be setup, if this is the case you can resolve the issue by setting the machine key for each server in your web farm. The error can also happen if the machine key changes between post backs which can sometime happen. I believe if you are not using a web farm this is well not happen very often. If you have a web farm this is the most likely cause.
      http://msdn.microsoft.com/en-us/library/ms998288.aspx

    2. It can be caused by spiders, a robots.txt file may help, but only if they are well behaved. A better solution might be to log the IP address of the clients causing the error and if they look like a spider, ban the IP address, be careful not to block legitimate users though.

    Sample robots.txt

    User-agent: *  
    Disallow: /WebSite/ScriptResource.axd  
    Disallow: /WebSite/WebResource.axd  
    

    3. The users session timing out will also cause this error.

    Hope one of these answers helps

    Sources
    1) System.Web.HttpException: This is an invalid script resource request
    2) http://www.mojoportal.com/Forums/Thread.aspx?pageid=5&mid=34&ItemID=2&thread=4501&pagenumber=1
    3) http://www.thestudentroom.co.uk/showthread.php?t=1258531#post25063929

    0 讨论(0)
提交回复
热议问题