Export (0) Print
Expand All

InputExtensions Class

Represents support for HTML input controls in an application.

System.Object
  System.Web.Mvc.Html.InputExtensions

Namespace:  System.Web.Mvc.Html
Assembly:  System.Web.Mvc (in System.Web.Mvc.dll)

public static class InputExtensions

  NameDescription
Public methodStatic memberCheckBox(HtmlHelper, String)Returns a check box input element by using the specified HTML helper and the name of the form field.
Public methodStatic memberCheckBox(HtmlHelper, String, Boolean)Returns a check box input element by using the specified HTML helper, the name of the form field, and a value to indicate whether the check box is selected.
Public methodStatic memberCheckBox(HtmlHelper, String, IDictionary<String, Object>)Returns a check box input element by using the specified HTML helper, the name of the form field, and the HTML attributes.
Public methodStatic memberCheckBox(HtmlHelper, String, Object)Returns a check box input element by using the specified HTML helper, the name of the form field, and the HTML attributes.
Public methodStatic memberCheckBox(HtmlHelper, String, Boolean, IDictionary<String, Object>)Returns a check box input element by using the specified HTML helper, the name of the form field, a value to indicate whether the check box is selected, and the HTML attributes.
Public methodStatic memberCheckBox(HtmlHelper, String, Boolean, Object)Returns a check box input element by using the specified HTML helper, the name of the form field, a value that indicates whether the check box is selected, and the HTML attributes.
Public methodStatic memberCheckBoxFor<TModel>(HtmlHelper<TModel>, Expression<Func<TModel, Boolean>>)Returns a check box input element for each property in the object that is represented by the specified expression.
Public methodStatic memberCheckBoxFor<TModel>(HtmlHelper<TModel>, Expression<Func<TModel, Boolean>>, IDictionary<String, Object>)Returns a check box input element for each property in the object that is represented by the specified expression, using the specified HTML attributes.
Public methodStatic memberCheckBoxFor<TModel>(HtmlHelper<TModel>, Expression<Func<TModel, Boolean>>, Object)Returns a check box input element for each property in the object that is represented by the specified expression, using the specified HTML attributes.
Public methodStatic memberHidden(HtmlHelper, String)Returns a hidden input element by using the specified HTML helper and the name of the form field.
Public methodStatic memberHidden(HtmlHelper, String, Object)Returns a hidden input element by using the specified HTML helper, the name of the form field, and the value.
Public methodStatic memberHidden(HtmlHelper, String, Object, IDictionary<String, Object>)Returns a hidden input element by using the specified HTML helper, the name of the form field, the value, and the HTML attributes.
Public methodStatic memberHidden(HtmlHelper, String, Object, Object)Returns a hidden input element by using the specified HTML helper, the name of the form field, the value, and the HTML attributes.
Public methodStatic memberHiddenFor<TModel, TProperty>(HtmlHelper<TModel>, Expression<Func<TModel, TProperty>>)Returns an HTML hidden input element for each property in the object that is represented by the specified expression.
Public methodStatic memberHiddenFor<TModel, TProperty>(HtmlHelper<TModel>, Expression<Func<TModel, TProperty>>, IDictionary<String, Object>)Returns an HTML hidden input element for each property in the object that is represented by the specified expression, using the specified HTML attributes.
Public methodStatic memberHiddenFor<TModel, TProperty>(HtmlHelper<TModel>, Expression<Func<TModel, TProperty>>, Object)Returns an HTML hidden input element for each property in the object that is represented by the specified expression, using the specified HTML attributes.
Public methodStatic memberPassword(HtmlHelper, String)Returns a password input element by using the specified HTML helper and the name of the form field.
Public methodStatic memberPassword(HtmlHelper, String, Object)Returns a password input element by using the specified HTML helper, the name of the form field, and the value.
Public methodStatic memberPassword(HtmlHelper, String, Object, IDictionary<String, Object>)Returns a password input element by using the specified HTML helper, the name of the form field, the value, and the HTML attributes.
Public methodStatic memberPassword(HtmlHelper, String, Object, Object)Returns a password input element by using the specified HTML helper, the name of the form field, the value, and the HTML attributes.
Public methodStatic memberPasswordFor<TModel, TProperty>(HtmlHelper<TModel>, Expression<Func<TModel, TProperty>>)Returns a password input element for each property in the object that is represented by the specified expression.
Public methodStatic memberPasswordFor<TModel, TProperty>(HtmlHelper<TModel>, Expression<Func<TModel, TProperty>>, IDictionary<String, Object>)Returns a password input element for each property in the object that is represented by the specified expression, using the specified HTML attributes.
Public methodStatic memberPasswordFor<TModel, TProperty>(HtmlHelper<TModel>, Expression<Func<TModel, TProperty>>, Object)Returns a password input element for each property in the object that is represented by the specified expression, using the specified HTML attributes.
Public methodStatic memberRadioButton(HtmlHelper, String, Object)Returns a radio button input element that is used to present mutually exclusive options.
Public methodStatic memberRadioButton(HtmlHelper, String, Object, Boolean)Returns a radio button input element that is used to present mutually exclusive options.
Public methodStatic memberRadioButton(HtmlHelper, String, Object, IDictionary<String, Object>)Returns a radio button input element that is used to present mutually exclusive options.
Public methodStatic memberRadioButton(HtmlHelper, String, Object, Object)Returns a radio button input element that is used to present mutually exclusive options.
Public methodStatic memberRadioButton(HtmlHelper, String, Object, Boolean, IDictionary<String, Object>)Returns a radio button input element that is used to present mutually exclusive options.
Public methodStatic memberRadioButton(HtmlHelper, String, Object, Boolean, Object)Returns a radio button input element that is used to present mutually exclusive options.
Public methodStatic memberRadioButtonFor<TModel, TProperty>(HtmlHelper<TModel>, Expression<Func<TModel, TProperty>>, Object)Returns a radio button input element for each property in the object that is represented by the specified expression.
Public methodStatic memberRadioButtonFor<TModel, TProperty>(HtmlHelper<TModel>, Expression<Func<TModel, TProperty>>, Object, IDictionary<String, Object>)Returns a radio button input element for each property in the object that is represented by the specified expression, using the specified HTML attributes.
Public methodStatic memberRadioButtonFor<TModel, TProperty>(HtmlHelper<TModel>, Expression<Func<TModel, TProperty>>, Object, Object)Returns a radio button input element for each property in the object that is represented by the specified expression, using the specified HTML attributes.
Public methodStatic memberTextBox(HtmlHelper, String)Returns a text input element by using the specified HTML helper and the name of the form field.
Public methodStatic memberTextBox(HtmlHelper, String, Object)Returns a text input element by using the specified HTML helper, the name of the form field, and the value.
Public methodStatic memberTextBox(HtmlHelper, String, Object, IDictionary<String, Object>)Returns a text input element by using the specified HTML helper, the name of the form field, the value, and the HTML attributes.
Public methodStatic memberTextBox(HtmlHelper, String, Object, Object)Returns a text input element by using the specified HTML helper, the name of the form field, the value, and the HTML attributes.
Public methodStatic memberTextBox(HtmlHelper, String, Object, String)Returns a text input element.
Public methodStatic memberTextBox(HtmlHelper, String, Object, String, IDictionary<String, Object>)Returns a text input element.
Public methodStatic memberTextBox(HtmlHelper, String, Object, String, Object)Returns a text input element.
Public methodStatic memberTextBoxFor<TModel, TProperty>(HtmlHelper<TModel>, Expression<Func<TModel, TProperty>>)Returns a text input element for each property in the object that is represented by the specified expression.
Public methodStatic memberTextBoxFor<TModel, TProperty>(HtmlHelper<TModel>, Expression<Func<TModel, TProperty>>, IDictionary<String, Object>)Returns a text input element for each property in the object that is represented by the specified expression, using the specified HTML attributes.
Public methodStatic memberTextBoxFor<TModel, TProperty>(HtmlHelper<TModel>, Expression<Func<TModel, TProperty>>, Object)Returns a text input element for each property in the object that is represented by the specified expression, using the specified HTML attributes.
Public methodStatic memberTextBoxFor<TModel, TProperty>(HtmlHelper<TModel>, Expression<Func<TModel, TProperty>>, String)Returns a text input element.
Public methodStatic memberTextBoxFor<TModel, TProperty>(HtmlHelper<TModel>, Expression<Func<TModel, TProperty>>, String, IDictionary<String, Object>)Returns a text input element.
Public methodStatic memberTextBoxFor<TModel, TProperty>(HtmlHelper<TModel>, Expression<Func<TModel, TProperty>>, String, Object)Returns a text input element.
Top

The InputExtensions class contains methods that extend the HtmlHelper class. Each extension method renders an HTML input element. With the exception of the Password extension method, each extension method can repopulate its values from the posted values by using the ModelState object. The following input element types are available in this class:

The following example shows how to use the methods of the InputExtensions class. The view displays a text box, a password box, some radio buttons, and some check boxes.

The following example shows a form. When the user submits the form, the Input action method processes the form data and renders a view.

In the following example, the view displays the data that was submitted.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2014 Microsoft