ASP.NET MVC 4 Attribute特性
2013-09-29 12:44
429 查看
Attributes特性
[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.为了标记一个动作方法的输入必须进行验证。
相关文章推荐
- 建立一个方法的attribute,可以放在任意方法上,可以自动记录方法出错时的信息,就不用写try 。。cacth. 【注意】 不是在asp.net MVC下,是在普通三层结构下写的的特性。
- Attribute(二)——自定义特性+Asp.net MVC中的filter详解
- Attribute(二)——自定义特性+Asp.net MVC中的filter详解
- ASP.NET MVC 4 Attribute特性
- ASP.NET 5与MVC 6中的新特性
- 解读ASP.NET 5 & MVC6系列(17):MVC中的其他新特性
- ASP.NET MVC 利用ActionFilterAttribute来做权限等
- ASP.NET MVC最新特性
- asp.net mvc各版本特性一览
- ASP.NET MVC之路由特性以及母版页呈现方式(十二)
- ASP.NET MVC 1.1 _VS2010 & ASP.NET MVC 2 新特性
- ASP.NET MVC 利用ActionFilterAttribute来判断用户是否登陆等等
- 【ASP.NET MVC 学习笔记】- 02 Attribute
- ASP.NET MVC 4 移动特性
- ASP.NET MVC 常用内置验证特性 简介
- ASP.NET MVC Beta 新特性之 IValueProvider
- 返璞归真 asp.net mvc (12) - asp.net mvc 4.0 新特性之移动特性
- asp.net mvc 配置好了特性路由却不能访问页面
- 【记录】ASP.NET MVC AuthorizeAttribute OnAuthorization 验证跳转
- Asp.net Mvc过滤器获取请求方法自定义特性