ASP.NET MVC 4 Attribute特性

來源:互聯網
上載者:User

標籤:cli   sed   get   ase   欄位   http post   rom   hid   field   

[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特性

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.