zoukankan      html  css  js  c++  java
  • 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.

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

  • 相关阅读:
    一、入门实例
    十四、事物配置
    JAVA-调用http链接
    ORACLE 年龄计算到月份
    ORACLE和MYSQL 去重查询
    JAVA--将图片转为BASE64编码并返回thymeleaf页面
    JAVA--将图片保存至项目路径
    java--获取类加载路径和项目根路径
    excel执行INSERT和UPDATE操作语句
    c# 未能加载Oracle.DataAccess, Version=2.112.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342
  • 原文地址:https://www.cnblogs.com/BrokenIce/p/6258927.html
Copyright © 2011-2022 走看看