且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

是否有Request.IsMvcAjaxRequest()相当于jQuery的?

更新时间:2023-11-28 23:25:10

下面是一个除了从M​​VC RC1发布说明 - 2009年1月

Here's an except from MVC RC1 release notes - Jan 2009

IsMvcAjaxRequest更名为IsAjaxRequest

该IsMvcAjaxRequest方法是   更名为IsAjaxRequest。作为...的一部分   这一变化,IsAjaxRequest方法   进行了更新,识别   的X请求,通过HTTP头。这是   由主要发送的公知的头   如JavaScript库   的Prototype.js,jQuery和道场。

The IsMvcAjaxRequest method been renamed to IsAjaxRequest. As part of this change, the IsAjaxRequest method was updated to recognize the X-Requested-With HTTP header. This is a well known header sent by the major JavaScript libraries such as Prototype.js, jQuery, and Dojo.

在ASP.NET AJAX佣工更新为发送这个头   要求。然而,他们继续   此外,它在形式的身体发   后期为了解决这个问题   这剥夺未知防火墙   头。

The ASP.NET AJAX helpers were updated to send this header in requests. However, they continue to also send it in the body of the form post in order to work around the issue of firewalls that strip unknown headers.

在换句话说 - 它是专门更名为更兼容与其他库

In other words - it was specifically renamed to be more 'compatible' with other libraries.

此外,任何人谁处理不当阅读完整的发布公告但一直用previous版本 - 甚至最近的β - 我强烈建议您阅读他们充分。这将节省您的时间在未来最有可能激发你的一些新功能。其相当惊人多少新的东西在里面。

In addition, for anyone who hasnt read the full release notes but has been using previous versions - even as recent as the beta - I STRONGLY recommend you read them in full. It will save you time in future and most likely excite you with some of the new features. Its quite surprising how much new stuff is in there.

重要提示::您将需要确保,如果升级从测试版RC1升级的.js文件MicrosoftAjax.MVC(没有确切的名字) - 否则这个方法是行不通的。它不是在发行说明作为必需任务中列出了升级,所以不要忘了。

Important note: You will need to make sure you upgrade the .js file for MicrosoftAjax.MVC (not the exact name) if upgrading to RC1 from the Beta - otherwise this method won't work. It isn't listed in the release notes as a required task for upgrading so don't forget to.