Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-mvc/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net mvc 在Firefox上加载图像时调用OnActionExecuting&;IE,但不在Chrome上_Asp.net Mvc_Internet Explorer_Google Chrome_Firefox_Action Filter - Fatal编程技术网

Asp.net mvc 在Firefox上加载图像时调用OnActionExecuting&;IE,但不在Chrome上

Asp.net mvc 在Firefox上加载图像时调用OnActionExecuting&;IE,但不在Chrome上,asp.net-mvc,internet-explorer,google-chrome,firefox,action-filter,Asp.net Mvc,Internet Explorer,Google Chrome,Firefox,Action Filter,我刚刚在一个OnActionExecuting动作中测试了我的代码,我注意到chrome的表现与Firefox&IE不同 Firefox&IE也会对图像(可能更多?)启动OnActionExecuting操作,而chrome则不会 我请求了属性:filterContext.RequestContext.HttpContext.Request.CurrentExecutionFilePathExtension 这将为我提供所请求url的扩展名。在我的例子中是:`“.png” 为什么chrome不启

我刚刚在一个
OnActionExecuting
动作中测试了我的代码,我注意到chrome的表现与Firefox&IE不同

Firefox&IE也会对图像(可能更多?)启动
OnActionExecuting
操作,而chrome则不会

我请求了属性:
filterContext.RequestContext.HttpContext.Request.CurrentExecutionFilePathExtension
这将为我提供所请求url的扩展名。在我的例子中是:`“.png”

为什么chrome不启动这个动作

注:(我没有进一步测试,当我注意到它触发图像时,我停止了测试。我测试的唯一浏览器是IE和Firefox)


这与ASP.NET MVC或浏览器有关吗?

请添加我们可以测试它的代码…您可以创建一个从ActionFilterAttribute继承的OnActionExecuting方法。我没有做其他特别的事情。这可能是因为chrome正在缓存图像,所以实际上没有调用服务器吗?