ASP. NET MVC 4 attribute features

Source: Internet
Author: User
Tags http post

[Acceptverbs (...)]

To specify HTTP verbs an action method would respond to.

An action method to specify the response of the HTTP verb.

[ActionName (...)]

To define the name of an action

Define the name of an action

[Additionalmetadata (...)]

To populate the Modelmetadata.additionalvalues dictionary for a model property.

Populate the modelmetadata.additionalvalues of a model property?? Dictionary.

[Allowhtml]

To allow HTML markup during model binding by skipping request validation for the property.

Allows HTML markup to be validated in model binding by skipping the properties of the request.

[AsyncTimeout (...)]

To set the timeout value, in milliseconds, for the asynchronous method.

The Async method to set the timeout value, in milliseconds.

[Authorize (...)]

To restrict access by callers to an action method.

The caller's action method to restrict access.

[Childactiononly]

To indicate this an action method should is called only as a child action.

To show that, as an action method should only be called by the quilt action.

[HandleError (...)]

To handle a exception that's thrown by an action method.

Handling exceptions is a way to throw an action method.

[Hiddeninput (...)]

To render a property or field value as a hidden INPUT element.

The value of a hidden INPUT element property or field to render.

[Httpdelete]

To restrict a action method to handle only HTTP DELETE requests.

Restricts an action method to handle only HTTP DELETE requests.

[HttpGet]

To restrict a action method to handle only HTTP Get requests.

Restricts an action method to handle only HTTP GET requests.

[HttpPost]

To restrict a action method to handle only HTTP Post requests.

Restrict an action method to handle only HTTP POST requests.

[Httpput]

To restrict a action method to handle only HTTP Put requests.

Restricts an action method to handle only HTTP put requests.

[Modelbinder (..)]

To associate a model type to a model-builder type.

Model Builder type for the associated model type.

[Noasynctimeout]

To set the timeout to infinite (never).

To set timeout infinity (never).

[Nonaction]

To indicate the a controller method is not an action method.

To show that the Controller method is not an action method.

[OutputCache (..)]

To mark an action method whose output would be cached.

In order to mark its output will be an action method of caching.

[Remote (...)]

It is used to invoke the server-based validation from client side.

It is used to invoke server-based authentication from the client.

[Requirehttps]

It forces an unsecured HTTP request to being re-sent over HTTPS.

It forces the re-sending of unsecured HTTP requests over HTTPS.

[SessionState (...)]

Specifies the session state of the Controller.

Specifies the session state of the Controller.

[ValidateInput (...)]

To mark action methods whose input must is validated.

In order to mark the input of an action method, it must be validated.

ASP. NET MVC 4 attribute features

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.