C# Class MvcContrib.FluentHtml.ViewDataContainerExtensions

Extensions to IViewDataContainer
Afficher le fichier Open project: atomicobject/mvccontrib

Méthodes publiques

Méthode 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 méthode

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.
Résultat Button

CheckBox() public static méthode

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.
Résultat CheckBox

CheckBoxList() public static méthode

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.
Résultat CheckBoxList

ColorPicker() public static méthode

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.
Résultat ColorPicker

DataList() public static méthode

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

DatePicker() public static méthode

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.
Résultat DatePicker

DateTimeLocalPicker() public static méthode

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.
Résultat DateTimeLocalPicker

DateTimePicker() public static méthode

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.
Résultat DateTimePicker

EmailBox() public static méthode

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.
Résultat EmailBox

FileUpload() public static méthode

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.
Résultat FileUpload

FormLiteral() public static méthode

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.
Résultat FormLiteral

GetBehaviors() public static méthode

public static GetBehaviors ( this view ) : IEnumerable
view this
Résultat IEnumerable

Hidden() public static méthode

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.
Résultat Hidden

Label() public static méthode

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.
Résultat Label

Literal() public static méthode

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

Literal() public static méthode

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.
Résultat Literal

MonthPicker() public static méthode

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.
Résultat MonthPicker

MultiSelect() public static méthode

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.
Résultat MultiSelect

NumberBox() public static méthode

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.
Résultat NumberBox

Password() public static méthode

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.
Résultat Password

RadioButton() public static méthode

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.
Résultat RadioButton

RadioSet() public static méthode

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.
Résultat RadioSet

RangeBox() public static méthode

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.
Résultat RangeBox

ResetButton() public static méthode

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.
Résultat ResetButton

SearchBox() public static méthode

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.
Résultat SearchBox

Select() public static méthode

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.
Résultat Select

SubmitButton() public static méthode

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.
Résultat SubmitButton

TelephoneBox() public static méthode

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.
Résultat TelephoneBox

TextArea() public static méthode

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.
Résultat TextArea

TextBox() public static méthode

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.
Résultat TextBox

TimePicker() public static méthode

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.
Résultat TimePicker

UrlBox() public static méthode

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.
Résultat UrlBox

WeekPicker() public static méthode

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.
Résultat WeekPicker