Is there any attribute relating to AJAX to be set for ASP.NET MVC controller actions?

后端 未结 6 895
轻奢々
轻奢々 2020-11-30 02:13

I want to use partial views with AJAX calls in ASP.NET MVC, and this is the first time I\'m using it. I just searched to see if there is anything special I should know befor

6条回答
  •  迷失自我
    2020-11-30 03:06

    There is an [AjaxOnly] attribute provided in the ASP.NET MVC 3 Futures collection. It's a part of the official ASP.NET MVC Codeplex site that provides features before they are officially included in a future version of ASP.NET MVC.

    You can download it here. To use it, add a reference to the Microsoft.Web.Mvc assembly included in the release package.

    There is an explanation of the attribute on this page, along with all the other great features you can use.

提交回复
热议问题