ASP.NET MVC 4 Attribute特性
[AcceptVerbs(…)]
To specify HTTP verbs an action method will respond to.
要指定HTTP动词的将响应的一个操作方法。
[ActionName(…)]
To define the name of an action
定义一个动作的名称
[AdditionalMetadata(…)]
to populate the ModelMetadata.AdditionalValues dictionary for a model property.
填充一个模型属性的ModelMetadata.AdditionalValues字典。
[AllowHtml]
To allow HTML markup during model binding by skipping request validation for the property.
允许HTML标记在模型绑定通过跳过属性的请求验证。
[AsyncTimeout(…)]
To set the timeout value, in milliseconds, for an asynchronous method.
要设置超时值,以毫秒为单位的异步方法。
[Authorize(…)]
To restrict access by callers to an action method.
调用者的操作方法来限制访问。
[ChildActionOnly]
To indicate that an action method should be called only as a child action.
要表明,作为一个的操作方法只应被子动作调用。
[HandleError(...)]
to handle an exception that is thrown by an action method.
处理异常就是将一个操作方法抛出。
[HiddenInput(…)]
To render a property or field value as a hidden input element.
为了呈现一个隐藏的输入元素属性或字段的值。
[HttpDelete]
to restrict an action method to handle only HTTP DELETE requests.
限制一个动作方法只处理HTTP DELETE请求。
[HttpGet]
to restrict an action method to handle only HTTP Get requests.
限制一个动作方法只处理HTTP GET请求。
[HttpPost]
to restrict an action method to handle only HTTP Post requests.
限制一个动作方法只处理HTTP POST请求。
[HttpPut]
to restrict an action method to handle only HTTP Put requests.
限制一个动作方法只处理HTTP PUT请求。
[ModelBinder(..)]
to associate a model type to a model-builder type.
关联模型类型的模型生成器类型。
[NoAsyncTimeout]
To set the timeout to infinite (never).
要设置超时无限(从不)。
[NonAction]
To indicate that a controller method is not an action method.
为了表明控制器方法不是一个操作方法。
[OutputCache(..)]
To mark an action method whose output will be cached.
为了标记其产出将是缓存的一个操作方法。
[Remote(…)]
It is used to invoke the server-based validation from client side.
它是用于从客户端调用基于服务器的验证。
[RequireHttps]
It forces an unsecured HTTP request to be re-sent over HTTPS.
它迫使重新通过HTTPS发送不安全的HTTP请求。
[SessionState(…)]
Specifies the session state of the controller.
指定控制器的会话状态。
[ValidateInput(...)]
To mark action methods whose input must be validated.
为了标记一个动作方法的输入必须进行验证。
ASP.NET MVC 4 Attribute特性的更多相关文章
- ASP.NET MVC基于标注特性的Model验证:将ValidationAttribute应用到参数上
原文:ASP.NET MVC基于标注特性的Model验证:将ValidationAttribute应用到参数上 ASP.NET MVC默认采用基于标准特性的Model验证机制,但是只有应用在Model ...
- ASP.NET MVC基于标注特性的Model验证:一个Model,多种验证规则
原文:ASP.NET MVC基于标注特性的Model验证:一个Model,多种验证规则 对于Model验证,理想的设计应该是场景驱动的,而不是Model(类型)驱动的,也就是对于同一个Model对象, ...
- 微软下一代站点开发框架:ASP.NET MVC 6 新特性揭秘
国内第一个<微软下一代站点开发框架:ASP.NET MVC 6 新特性揭秘 >课程 微软特邀讲师 徐雷!周六晚8点YY预定:id=28447" href="htt ...
- (转) 一步一步学习ASP.NET 5 (四)- ASP.NET MVC 6四大特性
转发:微软MVP 卢建晖 的文章,希望对大家有帮助.原文:http://blog.csdn.net/kinfey/article/details/44459625 编者语 : 昨晚写好的文章居然csd ...
- ASP.NET MVC中MaxLength特性设置无效
在ASP.NET MVC项目中,给某个Model打上了MaxLength特性如下: public class SomeClass { [MaxLength(16, ErrorMessage = &qu ...
- ASP.NET MVC 使用Remote特性实现远程属性验证
RemoteAttribute是asp.net mvc 的一个验证特性,它位于System.Web.Mvc命名空间 下面通过例子来说明 很多系统中都有会员这个功能,会员在前台注册时,用户名不能与现有的 ...
- [转][译]ASP.NET MVC 4 移动特性
此教程将讨论ASP.NET MVC 4 Web应用程序里的移动特性.对于此教程,可以使用 Visual Studio Express 2012 或者 Visual Web Developer 2010 ...
- ASP.NET MVC之路由特性以及母版页呈现方式(十二)
前言 这一节我们开始讲讲基础的东西也就是如题目所言,个人觉得当学习或者利用MVC时,必须得知道最新迭代版本新增了什么,至少得知道MVC 3.MVC 4或者MVC 5有什么区别,而不至于当利用到低版本时 ...
- Asp.net MVC 4 Attributes特性
Attributes特性 ActionFilterAttribute Represents the base class for filter attributes. 代表筛选器属性的基类. Acti ...
随机推荐
- C# 显示问题
- Linux下xampp集成环境安装配置方法 、部署bugfree及部署禅道
XAMPP(Apache+MySQL+PHP+PERL)是一个功能强大的建站集成软件包.XAMPP 是一个易于安装且包含 MySQL.PHP 和 Perl 的 Apache 发行版.XAMPP 的确非 ...
- StringEscapeUtils类的转义与反转义方法
第一步.下载Jar包(commons-lang.jar) 下载地址:http://commons.apache.org/proper/commons-lang/download_lang.cgi 第二 ...
- linux xorddos样本分析2
逆向分析 之后我们通过ida对该样本进行更深入的分析样本的main函数中,一开始会调用函数dec_conf对样本中的大量加密的字符串进行解密,如下图所示.
- swiper框架,实现轮播图等滑动效果
http://www.swiper.com.cn/ 做个记录而已,这个没什么好说的,对于需要手机端开发实现触摸等方式可以看看.
- Apache, Tomcat, JK Configuration Example
Example of worker.properties: worker.list=myWorker,yourWorker worker.myWorker.port=7505 worker.myWor ...
- 计算机视觉中的词袋模型(Bow,Bag-of-words)
计算机视觉中的词袋模型(Bow,Bag-of-words) Bag-of-words 读 'xw20084898的专栏'的blogBag-of-words model in computer visi ...
- SPOJ : DIVCNT2 - Counting Divisors (square)
设 \[f(n)=\sum_{d|n}\mu^2(d)\] 则 \[\begin{eqnarray*}\sigma_0(n^2)&=&\sum_{d|n}f(d)\\ans&= ...
- CSS3绘制404页面
标题有点噱了...最近在做一个交通有关的项目, 想做一个类似标志牌的404, 所以就有了这个. 只用的CSS3中的旋转, 效果如下 上代码: <!DOCTYPE html> <htm ...
- 利用 canvas 破解 某拖动验证码
利用 canvas 破解 某拖动验证码 http://my.oschina.net/u/237940/blog/337194