C# Class MvcContrib.FluentHtml.ViewDataContainerExtensions

Extensions to IViewDataContainer
Show file Open project: atomicobject/mvccontrib

Public Methods

Method Description
Button ( this view, string text ) : Button

Generate an HTML input element of type 'button.'

CheckBox ( this view, string name ) : CheckBox

Generate an HTML input element of type 'checkbox' and set checked from ViewData based on the name provided. The checkbox element has an accompanying input element of type 'hidden' to support binding upon form post.

CheckBoxList ( this view, string name ) : CheckBoxList

Generate a list of HTML input elements of type 'checkbox' and set its value from the ViewModel based on the expression provided. Each checkbox element has an accompanying input element of type 'hidden' to support binding upon form post.

ColorPicker ( this view, string name ) : ColorPicker

Generate an HTML input element of type 'color' and set its value from ViewData based on the name provided.

DataList ( this view, string id ) : DataList

Generate an HTML datalist element.

DatePicker ( this view, string name ) : DatePicker

Generate an HTML input element of type 'date' and set its value from ViewData based on the name provided.

DateTimeLocalPicker ( this view, string name ) : DateTimeLocalPicker

Generate an HTML input element of type 'datetime-local' and set its value from ViewData based on the name provided.

DateTimePicker ( this view, string name ) : DateTimePicker

Generate an HTML input element of type 'datetime' and set its value from ViewData based on the name provided.

EmailBox ( this view, string name ) : EmailBox

Generate an HTML input element of type 'url' and set its value from ViewData based on the name provided.

FileUpload ( this view, string name ) : FileUpload

Generate an HTML input element of type 'file' and set its value from ViewData based on the name provided.

FormLiteral ( this view, string name ) : FormLiteral

Generate an HTML span element and an HTML input element of type 'hidden' and set the inner text of the span and the value of the hidden input element from ViewData based on the specified name.

GetBehaviors ( this view ) : IEnumerable
Hidden ( this view, string name ) : Hidden

Generate an HTML input element of type 'hidden' and set its value from ViewData based on the name provided.

Label ( this view, string forName ) : Label

Generate an HTML label element;

Literal ( this view, object value ) : Literal

Generate an HTML span element.

Literal ( this view, string name, object value ) : Literal

Generate an HTML span element.

MonthPicker ( this view, string name ) : MonthPicker

Generate an HTML input element of type 'month' and set its value from ViewData based on the name provided.

MultiSelect ( this view, string name ) : MultiSelect

Generate an HTML select element with a multiselect attribute = 'true' and set its selected values from ViewData based on the name provided.

NumberBox ( this view, string name ) : NumberBox

Generate an HTML input element of type 'number' and set its value from ViewData based on the name provided.

Password ( this view, string name ) : Password

Generate an HTML input element of type 'password' and set its value from ViewData based on the name provided.

RadioButton ( this view, string name ) : RadioButton

Generate an HTML input element of type 'radio.'

RadioSet ( this view, string name ) : RadioSet

Generate a set of HTML input elements of type 'radio' -- each wrapped inside a label. The whole thing is wrapped in an HTML div element. The values of the input elements and he label text are taken from the options specified.

RangeBox ( this view, string name ) : RangeBox

Generate an HTML input element of type 'range' and set its value from ViewData based on the name provided.

ResetButton ( this view, string text ) : ResetButton

Generate an HTML input element of type 'reset.'

SearchBox ( this view, string name ) : SearchBox

Generate an HTML input element of type 'search' and set its value from ViewData based on the name provided.

Select ( this view, string name ) : Select

Generate an HTML select element and set its selected value from ViewData based on the name provided.

SubmitButton ( this view, string text ) : SubmitButton

Generate an HTML input element of type 'submit.'

TelephoneBox ( this view, string name ) : TelephoneBox

Generate an HTML input element of type 'tel' and set its value from ViewData based on the name provided.

TextArea ( this view, string name ) : TextArea

Generate an HTML textarea element and set the value from ViewData.

TextBox ( this view, string name ) : TextBox

Generate an HTML input element of type 'text' and set its value from ViewData based on the name provided.

TimePicker ( this view, string name ) : TimePicker

Generate an HTML input element of type 'time' and set its value from ViewData based on the name provided.

UrlBox ( this view, string name ) : UrlBox

Generate an HTML input element of type 'url' and set its value from ViewData based on the name provided.

WeekPicker ( this view, string name ) : WeekPicker

Generate an HTML input element of type 'week' and set its value from ViewData based on the name provided.

Method Details

Button() public static method

Generate an HTML input element of type 'button.'
public static Button ( this view, string text ) : Button
view this The view.
text string Value of the 'value' and 'name' attributes. Also used to derive the 'id' attribute.
return Button

CheckBox() public static method

Generate an HTML input element of type 'checkbox' and set checked from ViewData based on the name provided. The checkbox element has an accompanying input element of type 'hidden' to support binding upon form post.
public static CheckBox ( this view, string name ) : CheckBox
view this The view.
name string Value of the 'name' attribute of the element. Also used to derive the 'id' attribute.
return CheckBox

CheckBoxList() public static method

Generate a list of HTML input elements of type 'checkbox' and set its value from the ViewModel based on the expression provided. Each checkbox element has an accompanying input element of type 'hidden' to support binding upon form post.
public static CheckBoxList ( this view, string name ) : CheckBoxList
view this The view.
name string Value of the 'name' attribute of the element. Also used to derive the 'id' attribute.
return CheckBoxList

ColorPicker() public static method

Generate an HTML input element of type 'color' and set its value from ViewData based on the name provided.
public static ColorPicker ( this view, string name ) : ColorPicker
view this The view.
name string Value of the 'date' attribute of the element. Also used to derive the 'id' attribute.
return ColorPicker

DataList() public static method

Generate an HTML datalist element.
public static DataList ( this view, string id ) : DataList
view this The view.
id string
return DataList

DatePicker() public static method

Generate an HTML input element of type 'date' and set its value from ViewData based on the name provided.
public static DatePicker ( this view, string name ) : DatePicker
view this The view.
name string Value of the 'date' attribute of the element. Also used to derive the 'id' attribute.
return DatePicker

DateTimeLocalPicker() public static method

Generate an HTML input element of type 'datetime-local' and set its value from ViewData based on the name provided.
public static DateTimeLocalPicker ( this view, string name ) : DateTimeLocalPicker
view this The view.
name string Value of the 'date' attribute of the element. Also used to derive the 'id' attribute.
return DateTimeLocalPicker

DateTimePicker() public static method

Generate an HTML input element of type 'datetime' and set its value from ViewData based on the name provided.
public static DateTimePicker ( this view, string name ) : DateTimePicker
view this The view.
name string Value of the 'date' attribute of the element. Also used to derive the 'id' attribute.
return DateTimePicker

EmailBox() public static method

Generate an HTML input element of type 'url' and set its value from ViewData based on the name provided.
public static EmailBox ( this view, string name ) : EmailBox
view this The view.
name string Value of the 'date' attribute of the element. Also used to derive the 'id' attribute.
return EmailBox

FileUpload() public static method

Generate an HTML input element of type 'file' and set its value from ViewData based on the name provided.
public static FileUpload ( this view, string name ) : FileUpload
view this The view.
name string Value of the 'name' attribute of the element. Also used to derive the 'id' attribute.
return FileUpload

FormLiteral() public static method

Generate an HTML span element and an HTML input element of type 'hidden' and set the inner text of the span and the value of the hidden input element from ViewData based on the specified name.
public static FormLiteral ( this view, string name ) : FormLiteral
view this The view.
name string Value of the 'name' attribute of the element. Also used to derive the 'id' attribute.
return FormLiteral

GetBehaviors() public static method

public static GetBehaviors ( this view ) : IEnumerable
view this
return IEnumerable

Hidden() public static method

Generate an HTML input element of type 'hidden' and set its value from ViewData based on the name provided.
public static Hidden ( this view, string name ) : Hidden
view this The view.
name string Value of the 'name' attribute of the element. Also used to derive the 'id' attribute.
return Hidden

Label() public static method

Generate an HTML label element;
public static Label ( this view, string forName ) : Label
view this The view.
forName string The id of the target element to point to in the 'for' attribute.
return Label

Literal() public static method

Generate an HTML span element.
public static Literal ( this view, object value ) : Literal
view this The view.
value object The inner text.
return Literal

Literal() public static method

Generate an HTML span element.
public static Literal ( this view, string name, object value ) : Literal
view this The view.
name string The name of the element.
value object The inner text.
return Literal

MonthPicker() public static method

Generate an HTML input element of type 'month' and set its value from ViewData based on the name provided.
public static MonthPicker ( this view, string name ) : MonthPicker
view this The view.
name string Value of the 'date' attribute of the element. Also used to derive the 'id' attribute.
return MonthPicker

MultiSelect() public static method

Generate an HTML select element with a multiselect attribute = 'true' and set its selected values from ViewData based on the name provided.
public static MultiSelect ( this view, string name ) : MultiSelect
view this The view.
name string Value of the 'name' attribute of the element. Also used to derive the 'id' attribute.
return MultiSelect

NumberBox() public static method

Generate an HTML input element of type 'number' and set its value from ViewData based on the name provided.
public static NumberBox ( this view, string name ) : NumberBox
view this The view.
name string Value of the 'name' attribute of the element. Also used to derive the 'id' attribute.
return NumberBox

Password() public static method

Generate an HTML input element of type 'password' and set its value from ViewData based on the name provided.
public static Password ( this view, string name ) : Password
view this The view.
name string Value of the 'name' attribute of the element. Also used to derive the 'id' attribute.
return Password

RadioButton() public static method

Generate an HTML input element of type 'radio.'
public static RadioButton ( this view, string name ) : RadioButton
view this The view.
name string Value of the 'name' attribute of the of the input elements. Also used to derive the 'id' attributes.
return RadioButton

RadioSet() public static method

Generate a set of HTML input elements of type 'radio' -- each wrapped inside a label. The whole thing is wrapped in an HTML div element. The values of the input elements and he label text are taken from the options specified.
public static RadioSet ( this view, string name ) : RadioSet
view this The view.
name string Value of the 'name' attribute of the of the input elements. Also used to derive the 'id' attributes.
return RadioSet

RangeBox() public static method

Generate an HTML input element of type 'range' and set its value from ViewData based on the name provided.
public static RangeBox ( this view, string name ) : RangeBox
view this The view.
name string Value of the 'name' attribute of the element. Also used to derive the 'id' attribute.
return RangeBox

ResetButton() public static method

Generate an HTML input element of type 'reset.'
public static ResetButton ( this view, string text ) : ResetButton
view this The view.
text string Value of the 'value' and 'name' attributes. Also used to derive the 'id' attribute.
return ResetButton

SearchBox() public static method

Generate an HTML input element of type 'search' and set its value from ViewData based on the name provided.
public static SearchBox ( this view, string name ) : SearchBox
view this The view.
name string Value of the 'name' attribute of the element. Also used to derive the 'id' attribute.
return SearchBox

Select() public static method

Generate an HTML select element and set its selected value from ViewData based on the name provided.
public static Select ( this view, string name ) : Select
view this The view.
name string Value of the 'name' attribute of the element. Also used to derive the 'id' attribute.
return Select

SubmitButton() public static method

Generate an HTML input element of type 'submit.'
public static SubmitButton ( this view, string text ) : SubmitButton
view this The view.
text string Value of the 'value' and 'name' attributes. Also used to derive the 'id' attribute.
return SubmitButton

TelephoneBox() public static method

Generate an HTML input element of type 'tel' and set its value from ViewData based on the name provided.
public static TelephoneBox ( this view, string name ) : TelephoneBox
view this The view.
name string Value of the 'name' attribute of the element. Also used to derive the 'id' attribute.
return TelephoneBox

TextArea() public static method

Generate an HTML textarea element and set the value from ViewData.
public static TextArea ( this view, string name ) : TextArea
view this The view.
name string Value of the 'name' attribute of the element. Also used to derive the 'id' attribute.
return TextArea

TextBox() public static method

Generate an HTML input element of type 'text' and set its value from ViewData based on the name provided.
public static TextBox ( this view, string name ) : TextBox
view this The view.
name string Value of the 'name' attribute of the element. Also used to derive the 'id' attribute.
return TextBox

TimePicker() public static method

Generate an HTML input element of type 'time' and set its value from ViewData based on the name provided.
public static TimePicker ( this view, string name ) : TimePicker
view this The view.
name string Value of the 'date' attribute of the element. Also used to derive the 'id' attribute.
return TimePicker

UrlBox() public static method

Generate an HTML input element of type 'url' and set its value from ViewData based on the name provided.
public static UrlBox ( this view, string name ) : UrlBox
view this The view.
name string Value of the 'date' attribute of the element. Also used to derive the 'id' attribute.
return UrlBox

WeekPicker() public static method

Generate an HTML input element of type 'week' and set its value from ViewData based on the name provided.
public static WeekPicker ( this view, string name ) : WeekPicker
view this The view.
name string Value of the 'date' attribute of the element. Also used to derive the 'id' attribute.
return WeekPicker