博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
ASP.NET MVC 4 Attribute特性
阅读量:4338 次
发布时间:2019-06-07

本文共 2095 字,大约阅读时间需要 6 分钟。

[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.

为了标记一个动作方法的输入必须进行验证。

转载于:https://www.cnblogs.com/BrokenIce/p/6258927.html

你可能感兴趣的文章
模块and包
查看>>
【总结】01背包问题
查看>>
解析ArcGis的字段计算器(一)——数值型数据计算,从“面积计算”开始
查看>>
理解爬虫原理
查看>>
基础 - SVG
查看>>
Python基础-OS模块
查看>>
canvas填充样式
查看>>
Python----面向对象---异常处理
查看>>
[源码和文档分享]基于Newban的Nancyj字体Email签名工具
查看>>
文本框宽度自动适应文本宽度<
查看>>
委拖 lambda 匿名方法 匿名类 扩展方法
查看>>
整体二分——离线整体处理
查看>>
Python with语句
查看>>
ARC下dealloc过程及.cxx_destruct的探究
查看>>
log4j定义某个类的日志级别
查看>>
算法一小时-选择排序
查看>>
移动端js调试工具:eruda
查看>>
MySQL 8.0主从(Master-Slave)配置
查看>>
bzoj4002: [JLOI2015]有意义的字符串
查看>>
bzoj3195: [Jxoi2012]奇怪的道路
查看>>