• Share
    • Twitter
    • LinkedIn
    • Facebook
    • Email
  • Feedback
  • Improve this Doc

Class HtmlInputExtensions

Represents support for HTML input controls in an application.

Inheritance
System.Object
HtmlInputExtensions
Namespace: DotNetNuke.Web.Mvc.Helpers
Assembly: DotNetNuke.Web.Mvc.dll
Syntax
public static class HtmlInputExtensions : object

Methods

| Improve this Doc View Source

CheckBox(DnnHtmlHelper, 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.

Declaration
public static MvcHtmlString CheckBox(this DnnHtmlHelper html, string name, IDictionary<string, object> htmlAttributes)
Parameters
Type Name Description
DnnHtmlHelper html

The HTML helper instance that this method extends.

System.String name

The name of the form field.

IDictionary<System.String, System.Object> htmlAttributes

An object that contains the HTML attributes to set for the element.

Returns
Type Description
MvcHtmlString

An input element whose type attribute is set to "checkbox".

| Improve this Doc View Source

CheckBox(DnnHtmlHelper, 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.

Declaration
public static MvcHtmlString CheckBox(this DnnHtmlHelper html, string name, bool isChecked, IDictionary<string, object> htmlAttributes)
Parameters
Type Name Description
DnnHtmlHelper html

The HTML helper instance that this method extends.

System.String name

The name of the form field.

System.Boolean isChecked

true to select the check box; otherwise, false.

IDictionary<System.String, System.Object> htmlAttributes

An object that contains the HTML attributes to set for the element.

Returns
Type Description
MvcHtmlString

An input element whose type attribute is set to "checkbox".

| Improve this Doc View Source

CheckBox(DnnHtmlHelper, 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.

Declaration
public static MvcHtmlString CheckBox(this DnnHtmlHelper html, string name, bool isChecked, object htmlAttributes)
Parameters
Type Name Description
DnnHtmlHelper html

The HTML helper instance that this method extends.

System.String name

The name of the form field.

System.Boolean isChecked

true to select the check box; otherwise, false.

System.Object htmlAttributes

An object that contains the HTML attributes to set for the element.

Returns
Type Description
MvcHtmlString

An input element whose type attribute is set to "checkbox".

| Improve this Doc View Source

CheckBox(DnnHtmlHelper, 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.

Declaration
public static MvcHtmlString CheckBox(this DnnHtmlHelper html, string name, bool isChecked)
Parameters
Type Name Description
DnnHtmlHelper html

The HTML helper instance that this method extends.

System.String name

The name of the form field.

System.Boolean isChecked

true to select the check box; otherwise, false.

Returns
Type Description
MvcHtmlString

An input element whose type attribute is set to "checkbox".

| Improve this Doc View Source

CheckBox(DnnHtmlHelper, String, Object)

Returns a check box input element by using the specified HTML helper, the name of the form field, and the HTML attributes.

Declaration
public static MvcHtmlString CheckBox(this DnnHtmlHelper html, string name, object htmlAttributes)
Parameters
Type Name Description
DnnHtmlHelper html

The HTML helper instance that this method extends.

System.String name

The name of the form field.

System.Object htmlAttributes

An object that contains the HTML attributes to set for the element.

Returns
Type Description
MvcHtmlString

An input element whose type attribute is set to "checkbox".

| Improve this Doc View Source

CheckBox(DnnHtmlHelper, String)

Returns a check box input element by using the specified HTML helper and the name of the form field.

Declaration
public static MvcHtmlString CheckBox(this DnnHtmlHelper html, string name)
Parameters
Type Name Description
DnnHtmlHelper html

The HTML helper instance that this method extends.

System.String name

The name of the form field.

Returns
Type Description
MvcHtmlString

An input element whose type attribute is set to "checkbox".

| Improve this Doc View Source

CheckBoxFor<TModel>(DnnHtmlHelper<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.

Declaration
public static MvcHtmlString CheckBoxFor<TModel>(this DnnHtmlHelper<TModel> html, Expression<Func<TModel, bool>> expression, IDictionary<string, object> htmlAttributes)
Parameters
Type Name Description
DnnHtmlHelper<TModel> html

The HTML helper instance that this method extends.

Expression<Func<TModel, System.Boolean>> expression

An expression that identifies the object that contains the properties to render.

IDictionary<System.String, System.Object> htmlAttributes

A dictionary that contains the HTML attributes to set for the element.

Returns
Type Description
MvcHtmlString

An HTML input element whose type attribute is set to "checkbox" for each property in the object that is represented by the specified expression, using the specified HTML attributes.

Type Parameters
Name Description
TModel

The type of the model.

Exceptions
Type Condition
System.ArgumentNullException

The expression parameter is null.

| Improve this Doc View Source

CheckBoxFor<TModel>(DnnHtmlHelper<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.

Declaration
public static MvcHtmlString CheckBoxFor<TModel>(this DnnHtmlHelper<TModel> html, Expression<Func<TModel, bool>> expression, object htmlAttributes)
Parameters
Type Name Description
DnnHtmlHelper<TModel> html

The HTML helper instance that this method extends.

Expression<Func<TModel, System.Boolean>> expression

An expression that identifies the object that contains the properties to render.

System.Object htmlAttributes

An object that contains the HTML attributes to set for the element.

Returns
Type Description
MvcHtmlString

An HTML input element whose type attribute is set to "checkbox" for each property in the object that is represented by the specified expression, using the specified HTML attributes.

Type Parameters
Name Description
TModel

The type of the model.

Exceptions
Type Condition
System.ArgumentNullException

The expression parameter is null.

| Improve this Doc View Source

CheckBoxFor<TModel>(DnnHtmlHelper<TModel>, Expression<Func<TModel, Boolean>>)

Returns a check box input element for each property in the object that is represented by the specified expression.

Declaration
public static MvcHtmlString CheckBoxFor<TModel>(this DnnHtmlHelper<TModel> html, Expression<Func<TModel, bool>> expression)
Parameters
Type Name Description
DnnHtmlHelper<TModel> html

The HTML helper instance that this method extends.

Expression<Func<TModel, System.Boolean>> expression

An expression that identifies the object that contains the properties to render.

Returns
Type Description
MvcHtmlString

An HTML input element whose type attribute is set to "checkbox" for each property in the object that is represented by the specified expression.

Type Parameters
Name Description
TModel

The type of the model.

Exceptions
Type Condition
System.ArgumentNullException

The expression parameter is null.

| Improve this Doc View Source

Hidden(DnnHtmlHelper, 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.

Declaration
public static MvcHtmlString Hidden(this DnnHtmlHelper html, string name, object value, IDictionary<string, object> htmlAttributes)
Parameters
Type Name Description
DnnHtmlHelper html

The HTML helper instance that this method extends.

System.String name

The name of the form field and the System.Web.Mvc.ViewDataDictionary key that is used to look up the value.

System.Object value

The value of the hidden input element. The value of the element is retrieved from the System.Web.Mvc.ViewDataDictionary object. If no value exists there, the value is retrieved from the System.Web.Mvc.ModelStateDictionary object. If the element is not found in the System.Web.Mvc.ViewDataDictionary object or the System.Web.Mvc.ModelStateDictionary object, the value parameter is used.

IDictionary<System.String, System.Object> htmlAttributes

An object that contains the HTML attributes to set for the element.

Returns
Type Description
MvcHtmlString

An input element whose type attribute is set to "hidden".

| Improve this Doc View Source

Hidden(DnnHtmlHelper, 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.

Declaration
public static MvcHtmlString Hidden(this DnnHtmlHelper html, string name, object value, object htmlAttributes)
Parameters
Type Name Description
DnnHtmlHelper html

The HTML helper instance that this method extends.

System.String name

The name of the form field and the System.Web.Mvc.ViewDataDictionary key that is used to look up the value.

System.Object value

The value of the hidden input element The value of the element is retrieved from the System.Web.Mvc.ViewDataDictionary object. If no value exists there, the value is retrieved from the System.Web.Mvc.ModelStateDictionary object. If the element is not found in the System.Web.Mvc.ViewDataDictionary object or the System.Web.Mvc.ModelStateDictionary object, the value parameter is used.

System.Object htmlAttributes

An object that contains the HTML attributes to set for the element.

Returns
Type Description
MvcHtmlString

An input element whose type attribute is set to "hidden".

| Improve this Doc View Source

Hidden(DnnHtmlHelper, String, Object)

Returns a hidden input element by using the specified HTML helper, the name of the form field, and the value.

Declaration
public static MvcHtmlString Hidden(this DnnHtmlHelper html, string name, object value)
Parameters
Type Name Description
DnnHtmlHelper html

The HTML helper instance that this method extends.

System.String name

The name of the form field and the System.Web.Mvc.ViewDataDictionary key that is used to look up the value.

System.Object value

The value of the hidden input element. The value of the element is retrieved from the System.Web.Mvc.ViewDataDictionary object. If no value exists there, the value is retrieved from the System.Web.Mvc.ModelStateDictionary object. If the element is not found in the System.Web.Mvc.ViewDataDictionary or the System.Web.Mvc.ModelStateDictionary, the value parameter is used.

Returns
Type Description
MvcHtmlString

An input element whose type attribute is set to "hidden".

| Improve this Doc View Source

Hidden(DnnHtmlHelper, String)

Returns a hidden input element by using the specified HTML helper and the name of the form field.

Declaration
public static MvcHtmlString Hidden(this DnnHtmlHelper html, string name)
Parameters
Type Name Description
DnnHtmlHelper html

The HTML helper instance that this method extends.

System.String name

The name of the form field and the System.Web.Mvc.ViewDataDictionary key that is used to look up the value.

Returns
Type Description
MvcHtmlString

An input element whose type attribute is set to "hidden".

| Improve this Doc View Source

HiddenFor<TModel, TProperty>(DnnHtmlHelper<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.

Declaration
public static MvcHtmlString HiddenFor<TModel, TProperty>(this DnnHtmlHelper<TModel> html, Expression<Func<TModel, TProperty>> expression, IDictionary<string, object> htmlAttributes)
Parameters
Type Name Description
DnnHtmlHelper<TModel> html

The HTML helper instance that this method extends.

Expression<Func<TModel, TProperty>> expression

An expression that identifies the object that contains the properties to render.

IDictionary<System.String, System.Object> htmlAttributes

An object that contains the HTML attributes to set for the element.

Returns
Type Description
MvcHtmlString

An input element whose type attribute is set to "hidden" for each property in the object that is represented by the expression.

Type Parameters
Name Description
TModel

The type of the model.

TProperty

The type of the property.

| Improve this Doc View Source

HiddenFor<TModel, TProperty>(DnnHtmlHelper<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.

Declaration
public static MvcHtmlString HiddenFor<TModel, TProperty>(this DnnHtmlHelper<TModel> html, Expression<Func<TModel, TProperty>> expression, object htmlAttributes)
Parameters
Type Name Description
DnnHtmlHelper<TModel> html

The HTML helper instance that this method extends.

Expression<Func<TModel, TProperty>> expression

An expression that identifies the object that contains the properties to render.

System.Object htmlAttributes

An object that contains the HTML attributes to set for the element.

Returns
Type Description
MvcHtmlString

An input element whose type attribute is set to "hidden" for each property in the object that is represented by the expression.

Type Parameters
Name Description
TModel

The type of the model.

TProperty

The type of the property.

| Improve this Doc View Source

HiddenFor<TModel, TProperty>(DnnHtmlHelper<TModel>, Expression<Func<TModel, TProperty>>)

Returns an HTML hidden input element for each property in the object that is represented by the specified expression.

Declaration
public static MvcHtmlString HiddenFor<TModel, TProperty>(this DnnHtmlHelper<TModel> html, Expression<Func<TModel, TProperty>> expression)
Parameters
Type Name Description
DnnHtmlHelper<TModel> html

The HTML helper instance that this method extends.

Expression<Func<TModel, TProperty>> expression

An expression that identifies the object that contains the properties to render.

Returns
Type Description
MvcHtmlString

An input element whose type attribute is set to "hidden" for each property in the object that is represented by the expression.

Type Parameters
Name Description
TModel

The type of the model.

TProperty

The type of the property.

| Improve this Doc View Source

Password(DnnHtmlHelper, 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.

Declaration
public static MvcHtmlString Password(this DnnHtmlHelper html, string name, object value, IDictionary<string, object> htmlAttributes)
Parameters
Type Name Description
DnnHtmlHelper html

The HTML helper instance that this method extends.

System.String name

The name of the form field and the System.Web.Mvc.ViewDataDictionary key that is used to look up the value.

System.Object value

The value of the password input element. If this value is null, the value of the element is retrieved from the System.Web.Mvc.ViewDataDictionary object. If no value exists there, the value is retrieved from the System.Web.Mvc.ModelStateDictionary object.

IDictionary<System.String, System.Object> htmlAttributes

An object that contains the HTML attributes to set for the element.

Returns
Type Description
MvcHtmlString

An input element whose type attribute is set to "password".

| Improve this Doc View Source

Password(DnnHtmlHelper, 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.

Declaration
public static MvcHtmlString Password(this DnnHtmlHelper html, string name, object value, object htmlAttributes)
Parameters
Type Name Description
DnnHtmlHelper html

The HTML helper instance that this method extends.

System.String name

The name of the form field and the System.Web.Mvc.ViewDataDictionary key that is used to look up the value.

System.Object value

The value of the password input element. If this value is null, the value of the element is retrieved from the System.Web.Mvc.ViewDataDictionary object. If no value exists there, the value is retrieved from the System.Web.Mvc.ModelStateDictionary object.

System.Object htmlAttributes

An object that contains the HTML attributes to set for the element.

Returns
Type Description
MvcHtmlString

An input element whose type attribute is set to "password".

| Improve this Doc View Source

Password(DnnHtmlHelper, String, Object)

Returns a password input element by using the specified HTML helper, the name of the form field, and the value.

Declaration
public static MvcHtmlString Password(this DnnHtmlHelper html, string name, object value)
Parameters
Type Name Description
DnnHtmlHelper html

The HTML helper instance that this method extends.

System.String name

The name of the form field and the System.Web.Mvc.ViewDataDictionary key that is used to look up the value.

System.Object value

The value of the password input element. If this value is null, the value of the element is retrieved from the System.Web.Mvc.ViewDataDictionary object. If no value exists there, the value is retrieved from the System.Web.Mvc.ModelStateDictionary object.

Returns
Type Description
MvcHtmlString

An input element whose type attribute is set to "password".

| Improve this Doc View Source

Password(DnnHtmlHelper, String)

Returns a password input element by using the specified HTML helper and the name of the form field.

Declaration
public static MvcHtmlString Password(this DnnHtmlHelper html, string name)
Parameters
Type Name Description
DnnHtmlHelper html

The HTML helper instance that this method extends.

System.String name

The name of the form field and the System.Web.Mvc.ViewDataDictionary key that is used to look up the value.

Returns
Type Description
MvcHtmlString

An input element whose type attribute is set to "password".

| Improve this Doc View Source

PasswordFor<TModel, TProperty>(DnnHtmlHelper<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.

Declaration
public static MvcHtmlString PasswordFor<TModel, TProperty>(this DnnHtmlHelper<TModel> html, Expression<Func<TModel, TProperty>> expression, IDictionary<string, object> htmlAttributes)
Parameters
Type Name Description
DnnHtmlHelper<TModel> html

The HTML helper instance that this method extends.

Expression<Func<TModel, TProperty>> expression

An expression that identifies the object that contains the properties to render.

IDictionary<System.String, System.Object> htmlAttributes

A dictionary that contains the HTML attributes to set for the element.

Returns
Type Description
MvcHtmlString

An HTML input element whose type attribute is set to "password" for each property in the object that is represented by the specified expression, using the specified HTML attributes.

Type Parameters
Name Description
TModel

The type of the model.

TProperty

The type of the value.

Exceptions
Type Condition
System.ArgumentNullException

The expression parameter is null.

| Improve this Doc View Source

PasswordFor<TModel, TProperty>(DnnHtmlHelper<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.

Declaration
public static MvcHtmlString PasswordFor<TModel, TProperty>(this DnnHtmlHelper<TModel> html, Expression<Func<TModel, TProperty>> expression, object htmlAttributes)
Parameters
Type Name Description
DnnHtmlHelper<TModel> html

The HTML helper instance that this method extends.

Expression<Func<TModel, TProperty>> expression

An expression that identifies the object that contains the properties to render.

System.Object htmlAttributes

An object that contains the HTML attributes to set for the element.

Returns
Type Description
MvcHtmlString

An HTML input element whose type attribute is set to "password" for each property in the object that is represented by the specified expression, using the specified HTML attributes.

Type Parameters
Name Description
TModel

The type of the model.

TProperty

The type of the value.

Exceptions
Type Condition
System.ArgumentNullException

The expression parameter is null.

| Improve this Doc View Source

PasswordFor<TModel, TProperty>(DnnHtmlHelper<TModel>, Expression<Func<TModel, TProperty>>)

Returns a password input element for each property in the object that is represented by the specified expression.

Declaration
public static MvcHtmlString PasswordFor<TModel, TProperty>(this DnnHtmlHelper<TModel> html, Expression<Func<TModel, TProperty>> expression)
Parameters
Type Name Description
DnnHtmlHelper<TModel> html

The HTML helper instance that this method extends.

Expression<Func<TModel, TProperty>> expression

An expression that identifies the object that contains the properties to render.

Returns
Type Description
MvcHtmlString

An HTML input element whose type attribute is set to "password" for each property in the object that is represented by the specified expression.

Type Parameters
Name Description
TModel

The type of the model.

TProperty

The type of the value.

Exceptions
Type Condition
System.ArgumentNullException

The expression parameter is null.

| Improve this Doc View Source

RadioButton(DnnHtmlHelper, String, Object, IDictionary<String, Object>)

Returns a radio button input element that is used to present mutually exclusive options.

Declaration
public static MvcHtmlString RadioButton(this DnnHtmlHelper html, string name, object value, IDictionary<string, object> htmlAttributes)
Parameters
Type Name Description
DnnHtmlHelper html

The HTML helper instance that this method extends.

System.String name

The name of the form field and the System.Web.Mvc.ViewDataDictionary key that is used to look up the value.

System.Object value

If this radio button is selected, the value of the radio button that is submitted when the form is posted. If the value of the selected radio button in the System.Web.Mvc.ViewDataDictionary or the System.Web.Mvc.ModelStateDictionary object matches this value, this radio button is selected.

IDictionary<System.String, System.Object> htmlAttributes

An object that contains the HTML attributes to set for the element.

Returns
Type Description
MvcHtmlString

An input element whose type attribute is set to "radio".

Exceptions
Type Condition
System.ArgumentException

The name parameter is null or empty.

System.ArgumentNullException

The value parameter is null.

| Improve this Doc View Source

RadioButton(DnnHtmlHelper, String, Object, Boolean, IDictionary<String, Object>)

Returns a radio button input element that is used to present mutually exclusive options.

Declaration
public static MvcHtmlString RadioButton(this DnnHtmlHelper html, string name, object value, bool isChecked, IDictionary<string, object> htmlAttributes)
Parameters
Type Name Description
DnnHtmlHelper html

The HTML helper instance that this method extends.

System.String name

The name of the form field and the System.Web.Mvc.ViewDataDictionary key that is used to look up the value.

System.Object value

If this radio button is selected, the value of the radio button that is submitted when the form is posted. If the value of the selected radio button in the System.Web.Mvc.ViewDataDictionary or the System.Web.Mvc.ModelStateDictionary object matches this value, this radio button is selected.

System.Boolean isChecked

true to select the radio button; otherwise, false.

IDictionary<System.String, System.Object> htmlAttributes

An object that contains the HTML attributes to set for the element.

Returns
Type Description
MvcHtmlString

An input element whose type attribute is set to "radio".

Exceptions
Type Condition
System.ArgumentException

The name parameter is null or empty.

System.ArgumentNullException

The value parameter is null.

| Improve this Doc View Source

RadioButton(DnnHtmlHelper, String, Object, Boolean, Object)

Returns a radio button input element that is used to present mutually exclusive options.

Declaration
public static MvcHtmlString RadioButton(this DnnHtmlHelper html, string name, object value, bool isChecked, object htmlAttributes)
Parameters
Type Name Description
DnnHtmlHelper html

The HTML helper instance that this method extends.

System.String name

The name of the form field and the System.Web.Mvc.ViewDataDictionary key that is used to look up the value.

System.Object value

If this radio button is selected, the value of the radio button that is submitted when the form is posted. If the value of the selected radio button in the System.Web.Mvc.ViewDataDictionary or the System.Web.Mvc.ModelStateDictionary object matches this value, this radio button is selected.

System.Boolean isChecked

true to select the radio button; otherwise, false.

System.Object htmlAttributes

An object that contains the HTML attributes to set for the element.

Returns
Type Description
MvcHtmlString

An input element whose type attribute is set to "radio".

Exceptions
Type Condition
System.ArgumentException

The name parameter is null or empty.

System.ArgumentNullException

The value parameter is null.

| Improve this Doc View Source

RadioButton(DnnHtmlHelper, String, Object, Boolean)

Returns a radio button input element that is used to present mutually exclusive options.

Declaration
public static MvcHtmlString RadioButton(this DnnHtmlHelper html, string name, object value, bool isChecked)
Parameters
Type Name Description
DnnHtmlHelper html

The HTML helper instance that this method extends.

System.String name

The name of the form field and the System.Web.Mvc.ViewDataDictionary key that is used to look up the value.

System.Object value

If this radio button is selected, the value of the radio button that is submitted when the form is posted. If the value of the selected radio button in the System.Web.Mvc.ViewDataDictionary or the System.Web.Mvc.ModelStateDictionary object matches this value, this radio button is selected.

System.Boolean isChecked

true to select the radio button; otherwise, false.

Returns
Type Description
MvcHtmlString

An input element whose type attribute is set to "radio".

Exceptions
Type Condition
System.ArgumentException

The name parameter is null or empty.

System.ArgumentNullException

The value parameter is null.

| Improve this Doc View Source

RadioButton(DnnHtmlHelper, String, Object, Object)

Returns a radio button input element that is used to present mutually exclusive options.

Declaration
public static MvcHtmlString RadioButton(this DnnHtmlHelper html, string name, object value, object htmlAttributes)
Parameters
Type Name Description
DnnHtmlHelper html

The HTML helper instance that this method extends.

System.String name

The name of the form field and the System.Web.Mvc.ViewDataDictionary key that is used to look up the value.

System.Object value

If this radio button is selected, the value of the radio button that is submitted when the form is posted. If the value of the selected radio button in the System.Web.Mvc.ViewDataDictionary or the System.Web.Mvc.ModelStateDictionary object matches this value, this radio button is selected.

System.Object htmlAttributes

An object that contains the HTML attributes to set for the element.

Returns
Type Description
MvcHtmlString

An input element whose type attribute is set to "radio".

Exceptions
Type Condition
System.ArgumentException

The name parameter is null or empty.

System.ArgumentNullException

The value parameter is null.

| Improve this Doc View Source

RadioButton(DnnHtmlHelper, String, Object)

Returns a radio button input element that is used to present mutually exclusive options.

Declaration
public static MvcHtmlString RadioButton(this DnnHtmlHelper html, string name, object value)
Parameters
Type Name Description
DnnHtmlHelper html

The HTML helper instance that this method extends.

System.String name

The name of the form field and the System.Web.Mvc.ViewDataDictionary key that is used to look up the value.

System.Object value

If this radio button is selected, the value of the radio button that is submitted when the form is posted. If the value of the selected radio button in the System.Web.Mvc.ViewDataDictionary or the System.Web.Mvc.ModelStateDictionary object matches this value, this radio button is selected.

Returns
Type Description
MvcHtmlString

An input element whose type attribute is set to "radio".

Exceptions
Type Condition
System.ArgumentException

The name parameter is null or empty.

System.ArgumentNullException

The value parameter is null.

| Improve this Doc View Source

RadioButtonFor<TModel, TProperty>(DnnHtmlHelper<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.

Declaration
public static MvcHtmlString RadioButtonFor<TModel, TProperty>(this DnnHtmlHelper<TModel> html, Expression<Func<TModel, TProperty>> expression, object value, IDictionary<string, object> htmlAttributes)
Parameters
Type Name Description
DnnHtmlHelper<TModel> html

The HTML helper instance that this method extends.

Expression<Func<TModel, TProperty>> expression

An expression that identifies the object that contains the properties to render.

System.Object value

If this radio button is selected, the value of the radio button that is submitted when the form is posted. If the value of the selected radio button in the System.Web.Mvc.ViewDataDictionary or the System.Web.Mvc.ModelStateDictionary object matches this value, this radio button is selected.

IDictionary<System.String, System.Object> htmlAttributes

A dictionary that contains the HTML attributes to set for the element.

Returns
Type Description
MvcHtmlString

An HTML input element whose type attribute is set to "radio" for each property in the object that is represented by the specified expression, using the specified HTML attributes.

Type Parameters
Name Description
TModel

The type of the model.

TProperty

The type of the value.

Exceptions
Type Condition
System.ArgumentNullException

The value parameter is null.

| Improve this Doc View Source

RadioButtonFor<TModel, TProperty>(DnnHtmlHelper<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.

Declaration
public static MvcHtmlString RadioButtonFor<TModel, TProperty>(this DnnHtmlHelper<TModel> html, Expression<Func<TModel, TProperty>> expression, object value, object htmlAttributes)
Parameters
Type Name Description
DnnHtmlHelper<TModel> html

The HTML helper instance that this method extends.

Expression<Func<TModel, TProperty>> expression

An expression that identifies the object that contains the properties to render.

System.Object value

If this radio button is selected, the value of the radio button that is submitted when the form is posted. If the value of the selected radio button in the System.Web.Mvc.ViewDataDictionary or the System.Web.Mvc.ModelStateDictionary object matches this value, this radio button is selected.

System.Object htmlAttributes

An object that contains the HTML attributes to set for the element.

Returns
Type Description
MvcHtmlString

An HTML input element whose type attribute is set to "radio" for each property in the object that is represented by the specified expression, using the specified HTML attributes.

Type Parameters
Name Description
TModel

The type of the model.

TProperty

The type of the value.

Exceptions
Type Condition
System.ArgumentNullException

The value parameter is null.

| Improve this Doc View Source

RadioButtonFor<TModel, TProperty>(DnnHtmlHelper<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.

Declaration
public static MvcHtmlString RadioButtonFor<TModel, TProperty>(this DnnHtmlHelper<TModel> html, Expression<Func<TModel, TProperty>> expression, object value)
Parameters
Type Name Description
DnnHtmlHelper<TModel> html

The HTML helper instance that this method extends.

Expression<Func<TModel, TProperty>> expression

An expression that identifies the object that contains the properties to render.

System.Object value

If this radio button is selected, the value of the radio button that is submitted when the form is posted. If the value of the selected radio button in the System.Web.Mvc.ViewDataDictionary or the System.Web.Mvc.ModelStateDictionary object matches this value, this radio button is selected.

Returns
Type Description
MvcHtmlString

An HTML input element whose type attribute is set to "radio" for each property in the object that is represented by the specified expression.

Type Parameters
Name Description
TModel

The type of the model.

TProperty

The type of the value.

Exceptions
Type Condition
System.ArgumentNullException

The value parameter is null.

| Improve this Doc View Source

TextBox(DnnHtmlHelper, 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.

Declaration
public static MvcHtmlString TextBox(this DnnHtmlHelper html, string name, object value, IDictionary<string, object> htmlAttributes)
Parameters
Type Name Description
DnnHtmlHelper html

The HTML helper instance that this method extends.

System.String name

The name of the form field and the System.Web.Mvc.ViewDataDictionary key that is used to look up the value.

System.Object value

The value of the text input element. If this value is null, the value of the element is retrieved from the System.Web.Mvc.ViewDataDictionary object. If no value exists there, the value is retrieved from the System.Web.Mvc.ModelStateDictionary object.

IDictionary<System.String, System.Object> htmlAttributes

An object that contains the HTML attributes to set for the element.

Returns
Type Description
MvcHtmlString

An input element whose type attribute is set to "text".

| Improve this Doc View Source

TextBox(DnnHtmlHelper, 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.

Declaration
public static MvcHtmlString TextBox(this DnnHtmlHelper html, string name, object value, object htmlAttributes)
Parameters
Type Name Description
DnnHtmlHelper html

The HTML helper instance that this method extends.

System.String name

The name of the form field and the System.Web.Mvc.ViewDataDictionary key that is used to look up the value.

System.Object value

The value of the text input element. If this value is null, the value of the element is retrieved from the System.Web.Mvc.ViewDataDictionary object. If no value exists there, the value is retrieved from the System.Web.Mvc.ModelStateDictionary object.

System.Object htmlAttributes

An object that contains the HTML attributes to set for the element.

Returns
Type Description
MvcHtmlString

An input element whose type attribute is set to "text".

| Improve this Doc View Source

TextBox(DnnHtmlHelper, String, Object, String, IDictionary<String, Object>)

Returns a text input element.

Declaration
public static MvcHtmlString TextBox(this DnnHtmlHelper html, string name, object value, string format, IDictionary<string, object> htmlAttributes)
Parameters
Type Name Description
DnnHtmlHelper html

The HTML helper instance that this method extends.

System.String name

The name of the form field and the System.Web.Mvc.ViewDataDictionary key that is used to look up the value.

System.Object value

The value of the text input element. If this value is null, the value of the element is retrieved from the System.Web.Mvc.ViewDataDictionary object. If no value exists there, the value is retrieved from the System.Web.Mvc.ModelStateDictionary object.

System.String format

A string that is used to format the input.

IDictionary<System.String, System.Object> htmlAttributes

An object that contains the HTML attributes to set for the element.

Returns
Type Description
MvcHtmlString

An input element whose type attribute is set to "text".

| Improve this Doc View Source

TextBox(DnnHtmlHelper, String, Object, String, Object)

Returns a text input element.

Declaration
public static MvcHtmlString TextBox(this DnnHtmlHelper html, string name, object value, string format, object htmlAttributes)
Parameters
Type Name Description
DnnHtmlHelper html

The HTML helper instance that this method extends.

System.String name

The name of the form field and the System.Web.Mvc.ViewDataDictionary key that is used to look up the value.

System.Object value

The value of the text input element. If this value is null, the value of the element is retrieved from the System.Web.Mvc.ViewDataDictionary object. If no value exists there, the value is retrieved from the System.Web.Mvc.ModelStateDictionary object.

System.String format

A string that is used to format the input.

System.Object htmlAttributes

An object that contains the HTML attributes to set for the element.

Returns
Type Description
MvcHtmlString

An input element whose type attribute is set to "text".

| Improve this Doc View Source

TextBox(DnnHtmlHelper, String, Object, String)

Returns a text input element.

Declaration
public static MvcHtmlString TextBox(this DnnHtmlHelper html, string name, object value, string format)
Parameters
Type Name Description
DnnHtmlHelper html

The HTML helper instance that this method extends.

System.String name

The name of the form field.

System.Object value

The value of the text input element. If this value is null, the value of the element is retrieved from the System.Web.Mvc.ViewDataDictionary object. If no value exists there, the value is retrieved from the System.Web.Mvc.ModelStateDictionary object.

System.String format

A string that is used to format the input.

Returns
Type Description
MvcHtmlString

An input element whose type attribute is set to "text".

| Improve this Doc View Source

TextBox(DnnHtmlHelper, String, Object)

Returns a text input element by using the specified HTML helper, the name of the form field, and the value.

Declaration
public static MvcHtmlString TextBox(this DnnHtmlHelper html, string name, object value)
Parameters
Type Name Description
DnnHtmlHelper html

The HTML helper instance that this method extends.

System.String name

The name of the form field and the System.Web.Mvc.ViewDataDictionary key that is used to look up the value.

System.Object value

The value of the text input element. If this value is null, the value of the element is retrieved from the System.Web.Mvc.ViewDataDictionary object. If no value exists there, the value is retrieved from the System.Web.Mvc.ModelStateDictionary object.

Returns
Type Description
MvcHtmlString

An input element whose type attribute is set to "text".

| Improve this Doc View Source

TextBox(DnnHtmlHelper, String)

Returns a text input element by using the specified HTML helper and the name of the form field.

Declaration
public static MvcHtmlString TextBox(this DnnHtmlHelper html, string name)
Parameters
Type Name Description
DnnHtmlHelper html

The HTML helper instance that this method extends.

System.String name

The name of the form field and the System.Web.Mvc.ViewDataDictionary key that is used to look up the value.

Returns
Type Description
MvcHtmlString

An input element whose type attribute is set to "text".

| Improve this Doc View Source

TextBoxFor<TModel, TProperty>(DnnHtmlHelper<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.

Declaration
public static MvcHtmlString TextBoxFor<TModel, TProperty>(this DnnHtmlHelper<TModel> html, Expression<Func<TModel, TProperty>> expression, IDictionary<string, object> htmlAttributes)
Parameters
Type Name Description
DnnHtmlHelper<TModel> html

The HTML helper instance that this method extends.

Expression<Func<TModel, TProperty>> expression

An expression that identifies the object that contains the properties to render.

IDictionary<System.String, System.Object> htmlAttributes

A dictionary that contains the HTML attributes to set for the element.

Returns
Type Description
MvcHtmlString

An HTML input element type attribute is set to "text" for each property in the object that is represented by the expression.

Type Parameters
Name Description
TModel

The type of the model.

TProperty

The type of the value.

Exceptions
Type Condition
System.ArgumentException

The expression parameter is null or empty.

| Improve this Doc View Source

TextBoxFor<TModel, TProperty>(DnnHtmlHelper<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.

Declaration
public static MvcHtmlString TextBoxFor<TModel, TProperty>(this DnnHtmlHelper<TModel> html, Expression<Func<TModel, TProperty>> expression, object htmlAttributes)
Parameters
Type Name Description
DnnHtmlHelper<TModel> html

The HTML helper instance that this method extends.

Expression<Func<TModel, TProperty>> expression

An expression that identifies the object that contains the properties to render.

System.Object htmlAttributes

An object that contains the HTML attributes to set for the element.

Returns
Type Description
MvcHtmlString

An HTML input element whose type attribute is set to "text" for each property in the object that is represented by the expression.

Type Parameters
Name Description
TModel

The type of the model.

TProperty

The type of the value.

Exceptions
Type Condition
System.ArgumentException

The expression parameter is null or empty.

| Improve this Doc View Source

TextBoxFor<TModel, TProperty>(DnnHtmlHelper<TModel>, Expression<Func<TModel, TProperty>>, String, IDictionary<String, Object>)

Returns a text input element.

Declaration
public static MvcHtmlString TextBoxFor<TModel, TProperty>(this DnnHtmlHelper<TModel> html, Expression<Func<TModel, TProperty>> expression, string format, IDictionary<string, object> htmlAttributes)
Parameters
Type Name Description
DnnHtmlHelper<TModel> html

The HTML helper instance that this method extends.

Expression<Func<TModel, TProperty>> expression

An expression that identifies the object that contains the properties to display.

System.String format

A string that is used to format the input.

IDictionary<System.String, System.Object> htmlAttributes

An object that contains the HTML attributes to set for the element.

Returns
Type Description
MvcHtmlString

An input element whose type attribute is set to "text".

Type Parameters
Name Description
TModel

The type of the model.

TProperty

The type of the value.

| Improve this Doc View Source

TextBoxFor<TModel, TProperty>(DnnHtmlHelper<TModel>, Expression<Func<TModel, TProperty>>, String, Object)

Returns a text input element.

Declaration
public static MvcHtmlString TextBoxFor<TModel, TProperty>(this DnnHtmlHelper<TModel> html, Expression<Func<TModel, TProperty>> expression, string format, object htmlAttributes)
Parameters
Type Name Description
DnnHtmlHelper<TModel> html

The HTML helper instance that this method extends.

Expression<Func<TModel, TProperty>> expression

An expression that identifies the object that contains the properties to display.

System.String format

A string that is used to format the input.

System.Object htmlAttributes

An object that contains the HTML attributes to set for the element.

Returns
Type Description
MvcHtmlString

An input element whose type attribute is set to "text".

Type Parameters
Name Description
TModel

The type of the model.

TProperty

The type of the value.

| Improve this Doc View Source

TextBoxFor<TModel, TProperty>(DnnHtmlHelper<TModel>, Expression<Func<TModel, TProperty>>, String)

Returns a text input element.

Declaration
public static MvcHtmlString TextBoxFor<TModel, TProperty>(this DnnHtmlHelper<TModel> html, Expression<Func<TModel, TProperty>> expression, string format)
Parameters
Type Name Description
DnnHtmlHelper<TModel> html

The HTML helper instance that this method extends.

Expression<Func<TModel, TProperty>> expression

An expression that identifies the object that contains the properties to display.

System.String format

A string that is used to format the input.

Returns
Type Description
MvcHtmlString

An input element whose type attribute is set to "text".

Type Parameters
Name Description
TModel

The type of the model.

TProperty

The type of the value.

| Improve this Doc View Source

TextBoxFor<TModel, TProperty>(DnnHtmlHelper<TModel>, Expression<Func<TModel, TProperty>>)

Returns a text input element for each property in the object that is represented by the specified expression.

Declaration
public static MvcHtmlString TextBoxFor<TModel, TProperty>(this DnnHtmlHelper<TModel> html, Expression<Func<TModel, TProperty>> expression)
Parameters
Type Name Description
DnnHtmlHelper<TModel> html

The HTML helper instance that this method extends.

Expression<Func<TModel, TProperty>> expression

An expression that identifies the object that contains the properties to render.

Returns
Type Description
MvcHtmlString

An HTML input element whose type attribute is set to "text" for each property in the object that is represented by the expression.

Type Parameters
Name Description
TModel

The type of the model.

TProperty

The type of the value.

Exceptions
Type Condition
System.ArgumentException

The expression parameter is null or empty.

  • View Source
Back to top by the community, for the community... #DNNCMS