C# Class Castle.MonoRail.Framework.Helpers.HtmlHelper

Provides usefull common methods to generate HTML tags.
This helper provides the means to generate commonly used HTML tags. All of it's methods return String that holds resulting HTML.
Inheritance: AbstractHelper
Afficher le fichier Open project: nats/castle-1.0.3-mono

Méthodes publiques

Méthode Description
BuildOrderedList ( ICollection elements ) : String

Builds an ordered ol list from supplied ICollection. <ol> <li>0</li> ... <li>object</li> </ol>

Calling BuildOrderedList( ICollection ) results in: <ol> <li>0</li> <li>1</li> <li>2</li> <li>3</li> <li>4</li> <li>5</li> <li>object</li> </ol>

Items in elements are converted to string through Object.ToString.

BuildOrderedList ( ICollection elements, String styleClass, String itemClass ) : String

Builds an ordered ol list from supplied ICollection with ol and li tags CSS class set to supplied attributes. <ol class="styleClassArg"> <li class="itemClassArg">0</li> ... <li class="itemClassArg">object</li> </ol>

Calling BuildOrderedList( ICollection, "styleClassArg", "itemClassArg" ) results in: <ol class="styleClassArg"> <li class="itemClassArg">0</li> <li class="itemClassArg">1</li> <li class="itemClassArg">2</li> <li class="itemClassArg">3</li> <li class="itemClassArg">4</li> <li class="itemClassArg">5</li> <li class="itemClassArg">object</li> </ol>

Items in elements are converted to string through Object.ToString.

BuildUnorderedList ( ICollection elements ) : String

Builds an unordered ul list from supplied ICollection. <ul> <li>0</li> ... <li>object</li> </ul>

Calling BuildUnorderedList( ICollection ) results in: <ul> <li>0</li> <li>1</li> <li>2</li> <li>3</li> <li>4</li> <li>5</li> <li>object</li> </ul>

Items in elements are converted to string through Object.ToString.

BuildUnorderedList ( ICollection elements, String styleClass, String itemClass ) : String

Builds an unordered ul list from supplied ICollection with ul and li tags CSS class set to supplied attributes. <ol class="styleClassArg"> <li class="itemClassArg">0</li> ... <li class="itemClassArg">object</li> </ol>

Calling BuildUnorderedList( ICollection, "styleClassArg", "itemClassArg" ) results in: <ol class="styleClassArg"> <li class="itemClassArg">0</li> <li class="itemClassArg">1</li> <li class="itemClassArg">2</li> <li class="itemClassArg">3</li> <li class="itemClassArg">4</li> <li class="itemClassArg">5</li> <li class="itemClassArg">object</li> </ol>

Items in elements are converted to string through Object.ToString.

CreateOption ( String text, object value ) : String

TODO: Document this!

CreateOption ( String text, object value, IDictionary htmlAttributes ) : String

TODO: Document this!

Valid html attributes include: selected and disabled

CreateOptions ( ICollection elems, String textProperty, String valueProperty ) : String

Creates options elements from an ICollection. <option value="valueProp">textProp</option> <option value="0">textProp2</option> <option value="5">textProp3</option>

Calling CreateOptions( ICollection, "textPropertyArg", "valuePropertyArg", object ) with specific type objects results in: <option value="valueProp">textProp</option> <option value="0">textProp2</option> <option value="5">textProp3</option>

Calling CreateOptions( ICollection, "textPropertyArg", "valuePropertyArg", object ) with random type objects results in: <option>0</option> <option>1</option> <option>2</option> <option>3</option> <option>4</option> <option>5</option> <option>object</option> <option>MR.Logic.Controllers.HtmlHelperController+SampleClass</option> Notice that the last option was generated from an object of the type with the properties specified by and , but the method is already in the mode of working with random type objects. Explanation bellow describes two different modes of working with the method.

There are two possible usages of the method depending on the types of objects which can be present in elems: Random type objects Array is full of random type objects. Properties specified by and aren't used. Instead value argument is ommited and is invoked on each item in to retrieve text for an option tag. Single type objects Array is objects of one time. In this case textProperty and valueProperty can specify the names of the properties of that type to use for option tags generation. You cannot mix random type objects and specific type objects. CreateOptions is looking at the first item in the elems collection to get MethodInfo to access specified properties. If usage is mixed either an unexpected exception will be thrown or options will have unexpected strings.

CreateOptions ( ICollection elems, String textProperty, String valueProperty, object selectedValue ) : String

Creates options elements from an ICollection. <option value="valueProp" selected>textProp</option> <option value="0">textProp2</option> <option value="5">textProp3</option>

Calling CreateOptions( ICollection, "textPropertyArg", "valuePropertyArg", object ) with specific type objects results in: <option value="valueProp" selected>textProp</option> <option value="0">textProp2</option> <option value="5">textProp3</option>

Calling CreateOptions( ICollection, "textPropertyArg", "valuePropertyArg", object ) with random type objects results in: <option>0</option> <option>1</option> <option>2</option> <option>3</option> <option>4</option> <option>5</option> <option selected>object</option> <option>MR.Logic.Controllers.HtmlHelperController+SampleClass</option> Notice that the last option was generated from an object of the type with the properties specified by and , but the method is already in the mode of working with random type objects. Explanation bellow describes two different modes of working with the method.

There are two possible usages of the method depending on the types of objects which can be present in elems: Random type objects Array is full of random type objects. Properties specified by and aren't used. Instead value argument is ommited and is invoked on each item in to retrieve text for an option tag. Single type objects Array is objects of one time. In this case textProperty and valueProperty can specify the names of the properties of that type to use for option tags generation. You cannot mix random type objects and specific type objects. CreateOptions is looking at the first item in the elems collection to get MethodInfo to access specified properties. If usage is mixed either an unexpected exception will be thrown or options will have unexpected strings.

CreateOptionsFromArray ( Array elems, String textProperty, String valueProperty ) : String

Creates options elements from an Array. <option value="valueProp">textProp</option> <option value="0">textProp2</option> <option value="5">textProp3</option> CreateOptions(ICollection,String,String)

Calling CreateOptionsFromArray( Array, "textPropertyArg", "valuePropertyArg", object ) with specific type objects results in: <option value="valueProp">textProp</option> <option value="0">textProp2</option> <option value="5">textProp3</option>

Calling CreateOptionsFromArray( Array, "textPropertyArg", "valuePropertyArg", object ) with random type objects results in: <option>0</option> <option>1</option> <option>2</option> <option>3</option> <option>4</option> <option>5</option> <option>object</option> <option>MR.Logic.Controllers.HtmlHelperController+SampleClass</option> Notice that the last option was generated from an object of the type with the properties specified by and , but the method is already in the mode of working with random type objects. Explanation bellow describes two different modes of working with the method.

There are two possible usages of the method depending on the types of objects which can be present in elems: Random type objects Array is full of random type objects. Properties specified by and aren't used. Instead value argument is ommited and is invoked on each item in to retrieve text for an option tag. Single type objects Array is objects of one time. In this case textProperty and valueProperty can specify the names of the properties of that type to use for option tags generation. You cannot mix random type objects and specific type objects. CreateOptionsFromArray is looking at the first item in the elems collection to get MethodInfo to access specified properties. If usage is mixed either an unexpected exception will be thrown or options will have unexpected strings.

CreateOptionsFromArray relies on CreateOptions(ICollection,String,String) to generate all option tags.

CreateOptionsFromArray ( Array elems, String textProperty, String valueProperty, object selectedValue ) : String

Creates options elements from an Array. <option value="valueProp" selected>textProp</option> <option value="0">textProp2</option> <option value="5">textProp3</option> CreateOptions(ICollection,String,String,object)

Calling CreateOptionsFromArray( Array, "textPropertyArg", "valuePropertyArg", object ) with specific type objects results in: <option value="valueProp" selected>textProp</option> <option value="0">textProp2</option> <option value="5">textProp3</option>

Calling CreateOptionsFromArray( Array, "textPropertyArg", "valuePropertyArg", object ) with random type objects results in: <option>0</option> <option>1</option> <option>2</option> <option>3</option> <option>4</option> <option>5</option> <option selected>object</option> <option>MR.Logic.Controllers.HtmlHelperController+SampleClass</option> Notice that the last option was generated from an object of the type with the properties specified by and , but the method is already in the mode of working with random type objects. Explanation bellow describes two different modes of working with the method.

There are two possible usages of the method depending on the types of objects which can be present in elems: Random type objects Array is full of random type objects. Properties specified by and aren't used. Instead value argument is ommited and is invoked on each item in to retrieve text for an option tag. Single type objects Array is objects of one time. In this case textProperty and valueProperty can specify the names of the properties of that type to use for option tags generation. You cannot mix random type objects and specific type objects. CreateOptionsFromArray is looking at the first item in the elems collection to get MethodInfo to access specified properties. If usage is mixed either an unexpected exception will be thrown or options will have unexpected strings.

CreateOptionsFromArray relies on CreateOptions(ICollection,String,String,object) to generate all option tags.

CreateOptionsFromPrimitiveArray ( Array elems, String selected ) : String

Creates option elements from Array. Marks the option that matches the selected argument (if provided). <option>0</option> <option>1</option> ... <option>5</option> <option selected>selectedArg</option> <option>object</option>

Calling CreateOptionsFromPrimitiveArray( Array, "selectedArg" ) results in: <option>0</option> <option>1</option> <option>2</option> <option>3</option> <option>4</option> <option>5</option> <option selected>selectedArg</option> <option>object</option>

Elements in the array are converted to String using StringBuilder.AppendFormat(String,object).

DateTime ( String name, System.DateTime value ) : String

Creates three select tags to input day, month and year. <select name="nameArgday" id="nameArgday" > ... </select> <select name="nameArgmonth" id="nameArgmonth" > ... </select> <select name="nameArgyear" id="nameArgyear" > ... </select>

Calling DateTime( "nameArg", new DateTime( 2005, 07, 15 ) ) results in: <select name="nameArgday" id="nameArgday" > <option>1</option> <option>2</option> ... <option>14</option> <option selected>15</option> <option>16</option> ... <option>30</option> <option>31</option> </select> <select name="nameArgmonth" id="nameArgmonth" > <option>1</option> <option>2</option> ... <option>6</option> <option selected>7</option> <option>8</option> ... <option>11</option> <option>12</option> </select> <select name="nameArgyear" id="nameArgyear" > <option>1930</option> <option>1931</option> ... <option>2004</option> <option selected>2005</option> <option>2006</option> ... <option>2029</option> </select> As above example shows the year range is hardcoded between 1930 and 2029.

name is used to generate name and id for each select tag. Supplied String is concatenated with "day", "month", or "year" to create String for the tag attributes.

DateTime ( String name, System.DateTime value, IDictionary attributes ) : String

Creates three select tags to input day, month and year. <select name="nameArgday" id="nameArgday" key1="value1" key3="value3" key2="value2" > ... </select> <select name="nameArgmonth" id="nameArgmonth" key1="value1" key3="value3" key2="value2" > ... </select> <select name="nameArgyear" id="nameArgyear" key1="value1" key3="value3" key2="value2" > ... </select>

Calling DateTime( "nameArg", new DateTime( 2005, 07, 15 ), IDictionary ) results in: <select name="nameArgday" id="nameArgday" key1="value1" key2="value2" > <option>1</option> <option>2</option> ... <option>14</option> <option selected>15</option> <option>16</option> ... <option>30</option> <option>31</option> </select> <select name="nameArgmonth" id="nameArgmonth" key1="value1" key2="value2" > <option>1</option> <option>2</option> ... <option>6</option> <option selected>7</option> <option>8</option> ... <option>11</option> <option>12</option> </select> <select name="nameArgyear" id="nameArgyear" key1="value1" key2="value2" > <option>1930</option> <option>1931</option> ... <option>2004</option> <option selected>2005</option> <option>2006</option> ... <option>2029</option> </select> As above example shows the year range is hardcoded between 1930 and 2029.

name is used to generate name and id for each select tag. Supplied String is concatenated with "day", "month", or "year" to create String for the tag attributes.

attributes is used to generate additional attributes for each of the select tags. IDictionary.Keys are used to name attributes. IDictionary.Values are used to assign those attributes values.

EndFieldSet ( ) : String

Creates a closing fieldset tag. </fieldset> HtmlHelper.FieldSet

This method should be invoked after FieldSet to close the fieldset. Calling EndFieldSet() results in: </fieldset>

EndForm ( ) : String

Creates a closing form tag. </form> Form(String)

Calling EndForm() results in: </form>

EndOptionGroup ( ) : String

Creates a closing optgroup element.

EndSelect ( ) : String

Creates a closing select tag.

Calling EndSelect() results in: </select>

FieldSet ( String legend ) : String

Creates a fieldset tag with a legend. <fieldset><legend>legendArg</legend> HtmlHelper.EndFieldSet

Calling FieldSet( "legendArg" ) results in: <fieldset><legend>legendArg</legend>

Form ( String action ) : String

Creates a form tag with "post" method and specified action. <form method="post" action="actionArg"> HtmlHelper.EndForm

Calling Form( "actionArg" ) results in: <form method="post" action="actionArg">

Form ( String action, IDictionary attributes ) : String

Creates a form tag with the specified action attribute. <form action="actionArg"> HtmlHelper.EndForm

Form ( String action, String id, String method ) : String

Creates a form tag with the specified method, action and id attributes. <form method="methodArg" action="actionArg" id="idArg"> HtmlHelper.EndForm

Calling Form( "actionArg", "idArg", "methodArg" ) results in: <form method="methodArg" action="actionArg" id="idArg">

Form ( String action, String id, String method, String onSubmit ) : String

Creates a form tag with the specified method and action attributes, id and onSubmit event handler. <form method="methodArg" action="actionArg" id="idArg" onsubmit="onSubmitArg"> HtmlHelper.EndForm

Calling Form( "actionArg", "idArg", "methodArg", "onSubmitArg" ) results in: <form method="methodArg" action="actionArg" id="idArg" onsubmit="onSubmitArg">

FormTo ( String action ) : String

Creates a form tag targeting a URL in the style of the LinkTo(String, String) methods.

FormTo ( String controller, String action ) : String

Creates a form tag targeting a URL in the style of the LinkTo(String, String) methods.

FormTo ( String controller, String action, object id ) : String

Creates a form tag targeting a URL in the style of the LinkTo(String, String) methods.

FormToAttributed ( String controller, String action, IDictionary attributes ) : String

Creates a form tag targeting a URL in the style of the LinkToAttributed(String, String, String, IDictionary) methods.

FormToAttributed ( String controller, String action, object id, IDictionary attributes ) : String

Creates a form tag targeting a URL in the style of the LinkToAttributed(String, String, String, IDictionary) methods.

FormToAttributed ( String controller, String action, object id, string method, IDictionary attributes ) : String

Creates a form tag targeting a URL in the style of the LinkToAttributed(String, String, String, IDictionary) methods.

InputButton ( String value ) : String

Creates an input element of the button type. <input type="button" value="valueArg" />

Calling InputButton( "valueArg" ) results in: <input type="button" name="valueArg" value="valueArg" />

InputButton ( String name, String value ) : String

Creates an input element of the button type. <input type="button" name="nameArg" id="nameArg" value="valueArg" />

InputButton ( String name, String value, IDictionary attributes ) : String

Creates an input element of the button type. <input type="button" name="nameArg" id="nameArg" value="valueArg" />

InputCheckbox ( String name, Object value ) : String

Creates an input element of the checkbox type. <input type="checkbox" name="nameArg" id="nameArg" value="valueArg" />

Calling InputCheckbox( "name", "1" ) results in: <input type="checkbox" name="name" id="name" value="1" />

InputCheckbox ( String name, Object value, IDictionary attributes ) : String

Creates an input element of the checkbox type. <input type="checkbox" name="nameArg" id="nameArg" value="valueArg" />

InputCheckbox ( String name, Object value, bool isChecked ) : String

Creates an input element of the checkbox type. <input type="checkbox" name="nameArg" id="nameArg" value="valueArg" />

InputFile ( String name ) : String

Creates an input element of the file type. <input type="file" name="nameArg" />

Calling InputFile( "name" ) results in: <input type="file" name="name" />

InputFile ( String name, IDictionary attributes ) : String

Creates an input element of the file type. <input type="file" name="nameArg" />

InputHidden ( String name, String value ) : String

Creates an input hidden element

Calling InputHidden( "nameArg", "valueArg" ) results in: <input type="hidden" name="nameArg" id="nameArg" value="valueArg" />

InputHidden ( String name, object value ) : String

Creates a hidden type input element. <input type="hidden" name="nameArg" id="nameArg" value="object" />

Calling InputHidden( "nameArg", object ) results in: <input type="hidden" name="nameArg" id="nameArg" value="object" />

String for value attribute is retrieved from value via object.ToString.

If value is null String.Empty is used as the value String.

InputPassword ( String name ) : String

Creates an input element of password type

InputPassword ( String name, String value ) : String

Creates an input element of password type

InputPassword ( String name, String value, IDictionary attributes ) : String

Creates an input element of password type

InputRadio ( String name, Object value ) : String

Creates an input element of the radio type. <input type="radio" name="nameArg" value="valueArg" />

Calling InputRadio( "name", "1" ) results in: <input type="radio" name="name" value="1" />

InputRadio ( String name, Object value, IDictionary attributes ) : String

Creates an input element of the radio type. <input type="radio" name="nameArg" value="valueArg" />

InputText ( String name, String value ) : String

Creates an input element of the text type. <input type="text" name="nameArg" id="nameArg" value="valueArg" />

Calling InputText( "nameArg", "valueArg" ) results in: <input type="text" name="nameArg" id="nameArg" value="valueArg" />

InputText ( String name, String value, IDictionary attributes ) : String

Creates a hidden type input element. <input type="hidden" name="nameArg" id="nameArg" value="valueArg" />

InputText ( String name, String value, String id ) : String

Creates an input element of the text type with custom name and id. <input type="text" name="nameArg" id="idArg" value="valueArg" />

Calling InputText( "nameArg", "valueArg", "idArg" ) results in: <input type="text" name="nameArg" id="idArg" value="valueArg" />

InputText ( String name, String value, int size, int maxlength ) : String

Creates an input element of the text type of specified size and maxlength. <input type="text" name="nameArg" id="nameArg" value="valueArg" size="10" maxlength="10" />

Calling InputText( "nameArg", "valueArg", 10, 10 ) results in: <input type="text" name="nameArg" id="nameArg" value="valueArg" size="10" maxlength="10" />

InputText ( String name, String value, int size, int maxlength, IDictionary attributes ) : String

Creates an input element of the text type with specified size, maxlength and attributes. <input type="text" name="nameArg" id="nameArg" value="valueArg" size="10" maxlength="10" />

Calling InputText( "nameArg", "valueArg", 10, 10, IDictionary ) results in: <input type="text" name="nameArg" id="nameArg" value="valueArg" size="10" maxlength="10" key1="value1" key2="value2" />

attributes is used to generate additional attributes for the label tag. IDictionary.Keys are used to name attributes. IDictionary.Values are used to assign those attributes values.

LabelFor ( String forId, String label ) : String

Creates a label for the element indicated with forId. <label for="forIdArg">labelArg</label>

Calling LabelFor( "forIdArg", "labelArg" ) results in: <label for="forIdArg">labelArg</label>

LabelFor ( String forId, String label, IDictionary attributes ) : String

Creates a label for the element indicated with forId. <label key1="value1" key2="value2" for="forIdArg">labelArg</label>

Calling LabelFor( "forIdArg", "labelArg", IDictionary ) results in: <label key5="value5" key4="value4" key1="value1" key3="value3" key2="value2" for="forIdArg">labelArg</label>

Link ( String target, String linkText ) : String

Creates an anchor (link) to the target <a href="/sometarget.html">linkText</a>

Calling Link( "something.html", "to something" ) results in: <a href="something.html">something</a>

Link ( String target, String linkText, IDictionary attributes ) : String

Creates an anchor (link) to the target <a href="/sometarget.html">linkText</a>

Calling Link( "something.html", "to something", $DictHelper.CreateDict("class=mylinkclass") ) results in: <a href="something.html" class="mylinkclass">something</a>

LinkTo ( String name, IDictionary options ) : String

Creates an anchor (link) to the action on the current controller. <a href="/website/currentController/actionArg.rails">nameArg</a>

Calling LinkTo( "nameArg", DictHelper.CreateDict("controller=home","action=index") ) results in: <a href="/websiter/home/index.rails">nameArg</a>

LinkTo ( String name, String action ) : String

Creates an anchor (link) to the action on the current controller. <a href="/website/currentController/actionArg.rails">nameArg</a>

Calling LinkTo( "nameArg", "actionArg" ) results in: <a href="/websiter/currentController/actionArg.rails">nameArg</a>

LinkTo ( String name, String controller, String action ) : String

Creates an anchor (link) to the action on the specified controller. <a href="/website/controllerArg/actionArg.rails">nameArg</a>

Calling LinkTo( "nameArg", options ) results in: <a href="/website/controllerArg/actionArg.rails">nameArg</a>

LinkTo ( String name, String controller, String action, object id ) : String

Creates an anchor (link) to the action on the specified controller passing provided id. <a href="/website/controllerArg/actionArg.rails?id=objectId">nameArg</a>

Calling LinkTo( "nameArg", "controllerArg", "actionArg", object ) results in: <a href="/website/controllerArg/actionArg.rails?id=object">nameArg</a>

String.Format(String, object) is used to convert id to the actual String.

LinkToAttributed ( String name, String controller, String action, IDictionary attributes ) : String

Creates an anchor (link) to the action on the specified controller <a href="/website/controllerArg/actionArg.rails">nameArg</a>

Calling LinkToAttributed( "nameArg", "controllerArg", "actionArg", IDictionary ) results in: <a href="/website/controllerArg/actionArg.rails">nameArg</a>

LinkToAttributed ( String name, String controller, String action, object id, IDictionary attributes ) : String

Creates an anchor (link) to the action on the specified controller <a href="/website/controllerArg/actionArg.rails?id=x">nameArg</a>

Calling LinkToAttributed( "nameArg", "controllerArg", "actionArg", IDictionary ) results in: <a href="/website/controllerArg/actionArg.rails">nameArg</a>

LinkToWithPost ( String name, String action ) : String

Creates an anchor (link) to the action on the current controller that posts using a hidden form element.

LinkToWithPost ( String name, String action, String confirm ) : String

Creates an anchor (link) to the action on the current controller that posts using a hidden form element.

LinkToWithPost ( String name, String controller, String action, String confirm ) : String

Creates an anchor (link) to the action on the specified controller that posts using a hidden form element.

LinkToWithPost ( String name, String controller, String action, object id ) : String

Creates an anchor (link) to the action on the specified controller that posts using a hidden form element.

LinkToWithPost ( String name, String controller, String action, object id, String confirm ) : String

Creates an anchor (link) to the action on the specified controller that posts using a hidden form element.

LinkToWithPost ( String name, String action, object id ) : String

Creates an anchor (link) to the action on the current controller that posts using a hidden form element.

LinkToWithPost ( String name, String action, object id, string confirm ) : String

Creates an anchor (link) to the action on the current controller that posts using a hidden form element.

LinkToWithPostAttributed ( String name, String controller, String action, String confirm, IDictionary attributes ) : String

Creates an anchor (link) to the action on the specified controller that posts using a hidden form element.

LinkToWithPostAttributed ( String name, String controller, String action, object id, String confirm, IDictionary attributes ) : String

Creates an anchor (link) to the action on the specified controller that posts using a hidden form element.

MapToVirtual ( String target ) : String

Maps target to website virtual path. /website/targetArg

Calling MapToVirtual( "targetArg" ) results in: /website/targetArg

OptionGroup ( String label ) : String

Creates an opening optgroup element.

Select ( String name ) : String

Creates opening select tag. <select name="nameArg" id="nameArg">

Calling Select( "nameArg" ) results in: <select name="nameArg" id="nameArg">

Select ( String name, IDictionary attributes ) : String

Creates opening select tag. <select name="nameArg" id="nameArg" key1="value1" key2="value2" >

Calling Select( "nameArg", IDictionary ) results in: <select name="nameArg" id="nameArg" key1="value1" key2="value2" >

attributes is used to generate additional attributes for the label tag. IDictionary.Keys are used to name attributes. IDictionary.Values are used to assign those attributes values.

SubmitButton ( String value ) : String

Creates a submit button. <input type="submit" value="valueArg" />

Calling SubmitButton( "valueArg" ) results in: <input type="submit" value="valueArg" />

SubmitButton ( String value, IDictionary attributes ) : String

Creates a submit button. <input type="submit" value="valueArg" key1="value1" key2="value2" />

Calling SubmitButton( "valueArg", IDictionary ) results in: <input type="submit" value="valueArg" key1="value1" key2="value2" />

attributes is used to generate additional attributes for the label tag. IDictionary.Keys are used to name attributes. IDictionary.Values are used to assign those attributes values.

TextArea ( String name, int cols, int rows, String value ) : String

Creates a text area element. <textarea id="nameArg" name="nameArg" cols="10" rows="10">valueArg</textarea>

Calling TextArea( "nameArg", 10, 10, "valueArg" ) results in: <textarea id="nameArg" name="nameArg" cols="10" rows="10">valueArg</textarea>

Private Methods

Méthode Description
BuildList ( String tag, ICollection elements, String styleClass, String itemClass ) : String

Builds a list with list tag specified by tag from supplied ICollection with list tag and li tags CSS class set to supplied attributes. <listTag class="styleClassArg"> <li class="itemClassArg">0</li> ... <li class="itemClassArg">object</li> </listTag>

This method is can be used to generate custom type HTML list. Currently HTML support only two types of lists ordered (ol tag) and unodered (ultag). In general this method should be used by other methods responsible for constructing some specific list.

Calling BuildList( "listTag", ICollection, "styleClassArg", "itemClassArg" ) results in: <listTag class="styleClassArg"> <li class="itemClassArg">0</li> <li class="itemClassArg">1</li> <li class="itemClassArg">2</li> <li class="itemClassArg">3</li> <li class="itemClassArg">4</li> <li class="itemClassArg">5</li> <li class="itemClassArg">object</li> </listTag>

Items in elements are converted to string through Object.ToString.

BuildListItem ( String item, String itemClass ) : String

Generates a list item li tag. <li class="itemClassArg">object</li>

This method should be used to assist list generation.

Calling BuildListItem( "object", "itemClassArg" ) results in: <li class="itemClassArg">object</li>

GetMethod ( object elem, String property ) : MethodInfo

Gets the property get method.

This method is used to get the MethodInfo to retrieve specified property from the specified type.

IsSelected ( object value, object selectedValue, bool isMultiple ) : bool

Determines whether the specified value is selected.

Specified value is selected if it Object.Equals(object) to the selectedValue. Or if selectedValue is an array value is selected if Array.IndexOf(Array, object) can find it in selectedValue.

Method Details

BuildOrderedList() public méthode

Builds an ordered ol list from supplied ICollection. <ol> <li>0</li> ... <li>object</li> </ol>
Calling BuildOrderedList( ICollection ) results in: <ol> <li>0</li> <li>1</li> <li>2</li> <li>3</li> <li>4</li> <li>5</li> <li>object</li> </ol>

Items in elements are converted to string through Object.ToString.

public BuildOrderedList ( ICollection elements ) : String
elements ICollection Collection with items to use for the list generation.
Résultat String

BuildOrderedList() public méthode

Builds an ordered ol list from supplied ICollection with ol and li tags CSS class set to supplied attributes. <ol class="styleClassArg"> <li class="itemClassArg">0</li> ... <li class="itemClassArg">object</li> </ol>
Calling BuildOrderedList( ICollection, "styleClassArg", "itemClassArg" ) results in: <ol class="styleClassArg"> <li class="itemClassArg">0</li> <li class="itemClassArg">1</li> <li class="itemClassArg">2</li> <li class="itemClassArg">3</li> <li class="itemClassArg">4</li> <li class="itemClassArg">5</li> <li class="itemClassArg">object</li> </ol>

Items in elements are converted to string through Object.ToString.

public BuildOrderedList ( ICollection elements, String styleClass, String itemClass ) : String
elements ICollection Collection with items to use for the list generation.
styleClass String CSS class name of the list ol tag.
itemClass String CSS class name of the list item li tag.
Résultat String

BuildUnorderedList() public méthode

Builds an unordered ul list from supplied ICollection. <ul> <li>0</li> ... <li>object</li> </ul>
Calling BuildUnorderedList( ICollection ) results in: <ul> <li>0</li> <li>1</li> <li>2</li> <li>3</li> <li>4</li> <li>5</li> <li>object</li> </ul>

Items in elements are converted to string through Object.ToString.

public BuildUnorderedList ( ICollection elements ) : String
elements ICollection Collection with items to use for the list generation.
Résultat String

BuildUnorderedList() public méthode

Builds an unordered ul list from supplied ICollection with ul and li tags CSS class set to supplied attributes. <ol class="styleClassArg"> <li class="itemClassArg">0</li> ... <li class="itemClassArg">object</li> </ol>
Calling BuildUnorderedList( ICollection, "styleClassArg", "itemClassArg" ) results in: <ol class="styleClassArg"> <li class="itemClassArg">0</li> <li class="itemClassArg">1</li> <li class="itemClassArg">2</li> <li class="itemClassArg">3</li> <li class="itemClassArg">4</li> <li class="itemClassArg">5</li> <li class="itemClassArg">object</li> </ol>

Items in elements are converted to string through Object.ToString.

public BuildUnorderedList ( ICollection elements, String styleClass, String itemClass ) : String
elements ICollection Collection with items to use for the list generation.
styleClass String CSS class name of the list ul tag.
itemClass String CSS class name of the list item li tag.
Résultat String

CreateOption() public méthode

TODO: Document this!
public CreateOption ( String text, object value ) : String
text String
value object
Résultat String

CreateOption() public méthode

TODO: Document this!
Valid html attributes include: selected and disabled
public CreateOption ( String text, object value, IDictionary htmlAttributes ) : String
text String
value object
htmlAttributes IDictionary
Résultat String

CreateOptions() public méthode

Creates options elements from an ICollection. <option value="valueProp">textProp</option> <option value="0">textProp2</option> <option value="5">textProp3</option>
Calling CreateOptions( ICollection, "textPropertyArg", "valuePropertyArg", object ) with specific type objects results in: <option value="valueProp">textProp</option> <option value="0">textProp2</option> <option value="5">textProp3</option>

Calling CreateOptions( ICollection, "textPropertyArg", "valuePropertyArg", object ) with random type objects results in: <option>0</option> <option>1</option> <option>2</option> <option>3</option> <option>4</option> <option>5</option> <option>object</option> <option>MR.Logic.Controllers.HtmlHelperController+SampleClass</option> Notice that the last option was generated from an object of the type with the properties specified by and , but the method is already in the mode of working with random type objects. Explanation bellow describes two different modes of working with the method.

There are two possible usages of the method depending on the types of objects which can be present in elems: Random type objects Array is full of random type objects. Properties specified by and aren't used. Instead value argument is ommited and is invoked on each item in to retrieve text for an option tag. Single type objects Array is objects of one time. In this case textProperty and valueProperty can specify the names of the properties of that type to use for option tags generation. You cannot mix random type objects and specific type objects. CreateOptions is looking at the first item in the elems collection to get MethodInfo to access specified properties. If usage is mixed either an unexpected exception will be thrown or options will have unexpected strings.

public CreateOptions ( ICollection elems, String textProperty, String valueProperty ) : String
elems ICollection Collection of objects each of which describes an option tag.
textProperty String Name of the /// objects property with the value for each option tag's /// text.
valueProperty String Name of the objects property with the value for each /// option tag's value attribute value.
Résultat String

CreateOptions() public méthode

Creates options elements from an ICollection. <option value="valueProp" selected>textProp</option> <option value="0">textProp2</option> <option value="5">textProp3</option>
Calling CreateOptions( ICollection, "textPropertyArg", "valuePropertyArg", object ) with specific type objects results in: <option value="valueProp" selected>textProp</option> <option value="0">textProp2</option> <option value="5">textProp3</option>

Calling CreateOptions( ICollection, "textPropertyArg", "valuePropertyArg", object ) with random type objects results in: <option>0</option> <option>1</option> <option>2</option> <option>3</option> <option>4</option> <option>5</option> <option selected>object</option> <option>MR.Logic.Controllers.HtmlHelperController+SampleClass</option> Notice that the last option was generated from an object of the type with the properties specified by and , but the method is already in the mode of working with random type objects. Explanation bellow describes two different modes of working with the method.

There are two possible usages of the method depending on the types of objects which can be present in elems: Random type objects Array is full of random type objects. Properties specified by and aren't used. Instead value argument is ommited and is invoked on each item in to retrieve text for an option tag. Single type objects Array is objects of one time. In this case textProperty and valueProperty can specify the names of the properties of that type to use for option tags generation. You cannot mix random type objects and specific type objects. CreateOptions is looking at the first item in the elems collection to get MethodInfo to access specified properties. If usage is mixed either an unexpected exception will be thrown or options will have unexpected strings.

public CreateOptions ( ICollection elems, String textProperty, String valueProperty, object selectedValue ) : String
elems ICollection Collection of objects each of which describes an option tag.
textProperty String Name of the /// objects property with the value for each option tag's /// text.
valueProperty String Name of the objects property with the value for each /// option tag's value attribute value.
selectedValue object indicating which /// option tag is to be marked with selected /// attribute.
Résultat String

CreateOptionsFromArray() public méthode

Creates options elements from an Array. <option value="valueProp">textProp</option> <option value="0">textProp2</option> <option value="5">textProp3</option> CreateOptions(ICollection,String,String)
Calling CreateOptionsFromArray( Array, "textPropertyArg", "valuePropertyArg", object ) with specific type objects results in: <option value="valueProp">textProp</option> <option value="0">textProp2</option> <option value="5">textProp3</option>

Calling CreateOptionsFromArray( Array, "textPropertyArg", "valuePropertyArg", object ) with random type objects results in: <option>0</option> <option>1</option> <option>2</option> <option>3</option> <option>4</option> <option>5</option> <option>object</option> <option>MR.Logic.Controllers.HtmlHelperController+SampleClass</option> Notice that the last option was generated from an object of the type with the properties specified by and , but the method is already in the mode of working with random type objects. Explanation bellow describes two different modes of working with the method.

There are two possible usages of the method depending on the types of objects which can be present in elems: Random type objects Array is full of random type objects. Properties specified by and aren't used. Instead value argument is ommited and is invoked on each item in to retrieve text for an option tag. Single type objects Array is objects of one time. In this case textProperty and valueProperty can specify the names of the properties of that type to use for option tags generation. You cannot mix random type objects and specific type objects. CreateOptionsFromArray is looking at the first item in the elems collection to get MethodInfo to access specified properties. If usage is mixed either an unexpected exception will be thrown or options will have unexpected strings.

CreateOptionsFromArray relies on CreateOptions(ICollection,String,String) to generate all option tags.

public CreateOptionsFromArray ( Array elems, String textProperty, String valueProperty ) : String
elems System.Array Collection of objects each of which describes an option tag.
textProperty String Name of the /// objects property with the value for each option tag's /// text.
valueProperty String Name of the objects property with the value for each /// option tag's value attribute value.
Résultat String

CreateOptionsFromArray() public méthode

Creates options elements from an Array. <option value="valueProp" selected>textProp</option> <option value="0">textProp2</option> <option value="5">textProp3</option> CreateOptions(ICollection,String,String,object)
Calling CreateOptionsFromArray( Array, "textPropertyArg", "valuePropertyArg", object ) with specific type objects results in: <option value="valueProp" selected>textProp</option> <option value="0">textProp2</option> <option value="5">textProp3</option>

Calling CreateOptionsFromArray( Array, "textPropertyArg", "valuePropertyArg", object ) with random type objects results in: <option>0</option> <option>1</option> <option>2</option> <option>3</option> <option>4</option> <option>5</option> <option selected>object</option> <option>MR.Logic.Controllers.HtmlHelperController+SampleClass</option> Notice that the last option was generated from an object of the type with the properties specified by and , but the method is already in the mode of working with random type objects. Explanation bellow describes two different modes of working with the method.

There are two possible usages of the method depending on the types of objects which can be present in elems: Random type objects Array is full of random type objects. Properties specified by and aren't used. Instead value argument is ommited and is invoked on each item in to retrieve text for an option tag. Single type objects Array is objects of one time. In this case textProperty and valueProperty can specify the names of the properties of that type to use for option tags generation. You cannot mix random type objects and specific type objects. CreateOptionsFromArray is looking at the first item in the elems collection to get MethodInfo to access specified properties. If usage is mixed either an unexpected exception will be thrown or options will have unexpected strings.

CreateOptionsFromArray relies on CreateOptions(ICollection,String,String,object) to generate all option tags.

public CreateOptionsFromArray ( Array elems, String textProperty, String valueProperty, object selectedValue ) : String
elems System.Array Collection of objects each of which describes an option tag.
textProperty String Name of the /// objects property with the value for each option tag's /// text.
valueProperty String Name of the objects property with the value for each /// option tag's value attribute value.
selectedValue object indicating which /// option tag is to be marked with selected /// attribute.
Résultat String

CreateOptionsFromPrimitiveArray() public méthode

Creates option elements from Array. Marks the option that matches the selected argument (if provided). <option>0</option> <option>1</option> ... <option>5</option> <option selected>selectedArg</option> <option>object</option>
Calling CreateOptionsFromPrimitiveArray( Array, "selectedArg" ) results in: <option>0</option> <option>1</option> <option>2</option> <option>3</option> <option>4</option> <option>5</option> <option selected>selectedArg</option> <option>object</option>

Elements in the array are converted to String using StringBuilder.AppendFormat(String,object).

public CreateOptionsFromPrimitiveArray ( Array elems, String selected ) : String
elems System.Array Array of values for each option tag.
selected String Name of the option tag to mark selected.
Résultat String

DateTime() public méthode

Creates three select tags to input day, month and year. <select name="nameArgday" id="nameArgday" > ... </select> <select name="nameArgmonth" id="nameArgmonth" > ... </select> <select name="nameArgyear" id="nameArgyear" > ... </select>
Calling DateTime( "nameArg", new DateTime( 2005, 07, 15 ) ) results in: <select name="nameArgday" id="nameArgday" > <option>1</option> <option>2</option> ... <option>14</option> <option selected>15</option> <option>16</option> ... <option>30</option> <option>31</option> </select> <select name="nameArgmonth" id="nameArgmonth" > <option>1</option> <option>2</option> ... <option>6</option> <option selected>7</option> <option>8</option> ... <option>11</option> <option>12</option> </select> <select name="nameArgyear" id="nameArgyear" > <option>1930</option> <option>1931</option> ... <option>2004</option> <option selected>2005</option> <option>2006</option> ... <option>2029</option> </select> As above example shows the year range is hardcoded between 1930 and 2029.

name is used to generate name and id for each select tag. Supplied String is concatenated with "day", "month", or "year" to create String for the tag attributes.

public DateTime ( String name, System.DateTime value ) : String
name String Name to use with name and id arguments of the select tag.
value System.DateTime to use for default selected date.
Résultat String

DateTime() public méthode

Creates three select tags to input day, month and year. <select name="nameArgday" id="nameArgday" key1="value1" key3="value3" key2="value2" > ... </select> <select name="nameArgmonth" id="nameArgmonth" key1="value1" key3="value3" key2="value2" > ... </select> <select name="nameArgyear" id="nameArgyear" key1="value1" key3="value3" key2="value2" > ... </select>
Calling DateTime( "nameArg", new DateTime( 2005, 07, 15 ), IDictionary ) results in: <select name="nameArgday" id="nameArgday" key1="value1" key2="value2" > <option>1</option> <option>2</option> ... <option>14</option> <option selected>15</option> <option>16</option> ... <option>30</option> <option>31</option> </select> <select name="nameArgmonth" id="nameArgmonth" key1="value1" key2="value2" > <option>1</option> <option>2</option> ... <option>6</option> <option selected>7</option> <option>8</option> ... <option>11</option> <option>12</option> </select> <select name="nameArgyear" id="nameArgyear" key1="value1" key2="value2" > <option>1930</option> <option>1931</option> ... <option>2004</option> <option selected>2005</option> <option>2006</option> ... <option>2029</option> </select> As above example shows the year range is hardcoded between 1930 and 2029.

name is used to generate name and id for each select tag. Supplied String is concatenated with "day", "month", or "year" to create String for the tag attributes.

attributes is used to generate additional attributes for each of the select tags. IDictionary.Keys are used to name attributes. IDictionary.Values are used to assign those attributes values.

public DateTime ( String name, System.DateTime value, IDictionary attributes ) : String
name String Name to use with name and id arguments of the select tag.
value System.DateTime to use for default selected date.
attributes IDictionary Additional attributes for select tags.
Résultat String

EndFieldSet() public méthode

Creates a closing fieldset tag. </fieldset> HtmlHelper.FieldSet
This method should be invoked after FieldSet to close the fieldset. Calling EndFieldSet() results in: </fieldset>
public EndFieldSet ( ) : String
Résultat String

EndForm() public méthode

Creates a closing form tag. </form> Form(String)
Calling EndForm() results in: </form>
public EndForm ( ) : String
Résultat String

EndOptionGroup() public méthode

Creates a closing optgroup element.
public EndOptionGroup ( ) : String
Résultat String

EndSelect() public méthode

Creates a closing select tag.
Calling EndSelect() results in: </select>
public EndSelect ( ) : String
Résultat String

FieldSet() public méthode

Creates a fieldset tag with a legend. <fieldset><legend>legendArg</legend> HtmlHelper.EndFieldSet
Calling FieldSet( "legendArg" ) results in: <fieldset><legend>legendArg</legend>
public FieldSet ( String legend ) : String
legend String Legend to use within the fieldset.
Résultat String

Form() public méthode

Creates a form tag with "post" method and specified action. <form method="post" action="actionArg"> HtmlHelper.EndForm
Calling Form( "actionArg" ) results in: <form method="post" action="actionArg">
public Form ( String action ) : String
action String Target action for the form.
Résultat String

Form() public méthode

Creates a form tag with the specified action attribute. <form action="actionArg"> HtmlHelper.EndForm
public Form ( String action, IDictionary attributes ) : String
action String Target action for the form.
attributes IDictionary Html Attributes for the form tag
Résultat String

Form() public méthode

Creates a form tag with the specified method, action and id attributes. <form method="methodArg" action="actionArg" id="idArg"> HtmlHelper.EndForm
Calling Form( "actionArg", "idArg", "methodArg" ) results in: <form method="methodArg" action="actionArg" id="idArg">
public Form ( String action, String id, String method ) : String
action String Target action for the form.
id String Form HTML ID.
method String Form method (get, post, etc).
Résultat String

Form() public méthode

Creates a form tag with the specified method and action attributes, id and onSubmit event handler. <form method="methodArg" action="actionArg" id="idArg" onsubmit="onSubmitArg"> HtmlHelper.EndForm
Calling Form( "actionArg", "idArg", "methodArg", "onSubmitArg" ) results in: <form method="methodArg" action="actionArg" id="idArg" onsubmit="onSubmitArg">
public Form ( String action, String id, String method, String onSubmit ) : String
action String Target action for the form.
id String Form HTML ID.
method String Form method (get, post, etc).
onSubmit String JavaScript inline code to be invoked upon form submission.
Résultat String

FormTo() public méthode

Creates a form tag targeting a URL in the style of the LinkTo(String, String) methods.
public FormTo ( String action ) : String
action String An action on the current controller.
Résultat String

FormTo() public méthode

Creates a form tag targeting a URL in the style of the LinkTo(String, String) methods.
public FormTo ( String controller, String action ) : String
controller String A controller name.
action String An action on .
Résultat String

FormTo() public méthode

Creates a form tag targeting a URL in the style of the LinkTo(String, String) methods.
public FormTo ( String controller, String action, object id ) : String
controller String A controller name.
action String An action on .
id object Object to use for the action ID argument.
Résultat String

FormToAttributed() public méthode

Creates a form tag targeting a URL in the style of the LinkToAttributed(String, String, String, IDictionary) methods.
public FormToAttributed ( String controller, String action, IDictionary attributes ) : String
controller String A controller name.
action String An action on .
attributes IDictionary Additional attributes for the form tag.
Résultat String

FormToAttributed() public méthode

Creates a form tag targeting a URL in the style of the LinkToAttributed(String, String, String, IDictionary) methods.
public FormToAttributed ( String controller, String action, object id, IDictionary attributes ) : String
controller String A controller name.
action String An action on .
id object Object to use for the action ID argument.
attributes IDictionary Additional attributes for the form tag.
Résultat String

FormToAttributed() public méthode

Creates a form tag targeting a URL in the style of the LinkToAttributed(String, String, String, IDictionary) methods.
public FormToAttributed ( String controller, String action, object id, string method, IDictionary attributes ) : String
controller String A controller name.
action String An action on .
id object Object to use for the action ID argument.
method string Form method (get, post, etc).
attributes IDictionary Additional attributes for the form tag.
Résultat String

InputButton() public méthode

Creates an input element of the button type. <input type="button" value="valueArg" />
Calling InputButton( "valueArg" ) results in: <input type="button" name="valueArg" value="valueArg" />
public InputButton ( String value ) : String
value String for value attribute.
Résultat String

InputButton() public méthode

Creates an input element of the button type. <input type="button" name="nameArg" id="nameArg" value="valueArg" />
public InputButton ( String name, String value ) : String
name String Value for name and id attributes.
value String for value attribute.
Résultat String

InputButton() public méthode

Creates an input element of the button type. <input type="button" name="nameArg" id="nameArg" value="valueArg" />
public InputButton ( String name, String value, IDictionary attributes ) : String
name String Value for name and id attributes.
value String for value attribute.
attributes IDictionary Additional attributes for the input tag.
Résultat String

InputCheckbox() public méthode

Creates an input element of the checkbox type. <input type="checkbox" name="nameArg" id="nameArg" value="valueArg" />
Calling InputCheckbox( "name", "1" ) results in: <input type="checkbox" name="name" id="name" value="1" />
public InputCheckbox ( String name, Object value ) : String
name String Value for name and id attributes.
value Object for value attribute.
Résultat String

InputCheckbox() public méthode

Creates an input element of the checkbox type. <input type="checkbox" name="nameArg" id="nameArg" value="valueArg" />
public InputCheckbox ( String name, Object value, IDictionary attributes ) : String
name String Value for name and id attributes.
value Object for value attribute.
attributes IDictionary Additional attributes for the input tag.
Résultat String

InputCheckbox() public méthode

Creates an input element of the checkbox type. <input type="checkbox" name="nameArg" id="nameArg" value="valueArg" />
public InputCheckbox ( String name, Object value, bool isChecked ) : String
name String Value for name and id attributes.
value Object for value attribute.
isChecked bool If true, adds the checked attributed to the tag
Résultat String

InputFile() public méthode

Creates an input element of the file type. <input type="file" name="nameArg" />
Calling InputFile( "name" ) results in: <input type="file" name="name" />
public InputFile ( String name ) : String
name String Value for name attribute.
Résultat String

InputFile() public méthode

Creates an input element of the file type. <input type="file" name="nameArg" />
public InputFile ( String name, IDictionary attributes ) : String
name String Value for name attribute.
attributes IDictionary Additional attributes for the input tag.
Résultat String

InputHidden() public méthode

Creates an input hidden element
Calling InputHidden( "nameArg", "valueArg" ) results in: <input type="hidden" name="nameArg" id="nameArg" value="valueArg" />
public InputHidden ( String name, String value ) : String
name String Value for name and id attributes.
value String for value attribute.
Résultat String

InputHidden() public méthode

Creates a hidden type input element. <input type="hidden" name="nameArg" id="nameArg" value="object" />
Calling InputHidden( "nameArg", object ) results in: <input type="hidden" name="nameArg" id="nameArg" value="object" />

String for value attribute is retrieved from value via object.ToString.

If value is null String.Empty is used as the value String.

public InputHidden ( String name, object value ) : String
name String Value for name and id attributes.
value object to supply for value attribute.
Résultat String

InputPassword() public méthode

Creates an input element of password type
public InputPassword ( String name ) : String
name String
Résultat String

InputPassword() public méthode

Creates an input element of password type
public InputPassword ( String name, String value ) : String
name String
value String
Résultat String

InputPassword() public méthode

Creates an input element of password type
public InputPassword ( String name, String value, IDictionary attributes ) : String
name String
value String
attributes IDictionary
Résultat String

InputRadio() public méthode

Creates an input element of the radio type. <input type="radio" name="nameArg" value="valueArg" />
Calling InputRadio( "name", "1" ) results in: <input type="radio" name="name" value="1" />
public InputRadio ( String name, Object value ) : String
name String Value for name attribute.
value Object for value attribute.
Résultat String

InputRadio() public méthode

Creates an input element of the radio type. <input type="radio" name="nameArg" value="valueArg" />
public InputRadio ( String name, Object value, IDictionary attributes ) : String
name String Value for name attribute.
value Object for value attribute.
attributes IDictionary Additional attributes for the input tag.
Résultat String

InputText() public méthode

Creates an input element of the text type. <input type="text" name="nameArg" id="nameArg" value="valueArg" />
Calling InputText( "nameArg", "valueArg" ) results in: <input type="text" name="nameArg" id="nameArg" value="valueArg" />
public InputText ( String name, String value ) : String
name String Value for name and id attributes.
value String for value attribute.
Résultat String

InputText() public méthode

Creates a hidden type input element. <input type="hidden" name="nameArg" id="nameArg" value="valueArg" />
public InputText ( String name, String value, IDictionary attributes ) : String
name String
value String
attributes IDictionary
Résultat String

InputText() public méthode

Creates an input element of the text type with custom name and id. <input type="text" name="nameArg" id="idArg" value="valueArg" />
Calling InputText( "nameArg", "valueArg", "idArg" ) results in: <input type="text" name="nameArg" id="idArg" value="valueArg" />
public InputText ( String name, String value, String id ) : String
name String name attribute value.
value String for value attribute.
id String id attribute value.
Résultat String

InputText() public méthode

Creates an input element of the text type of specified size and maxlength. <input type="text" name="nameArg" id="nameArg" value="valueArg" size="10" maxlength="10" />
Calling InputText( "nameArg", "valueArg", 10, 10 ) results in: <input type="text" name="nameArg" id="nameArg" value="valueArg" size="10" maxlength="10" />
public InputText ( String name, String value, int size, int maxlength ) : String
name String Value for name and id attributes.
value String for value attribute.
size int size attribute value.
maxlength int maxlength attribute value.
Résultat String

InputText() public méthode

Creates an input element of the text type with specified size, maxlength and attributes. <input type="text" name="nameArg" id="nameArg" value="valueArg" size="10" maxlength="10" />
Calling InputText( "nameArg", "valueArg", 10, 10, IDictionary ) results in: <input type="text" name="nameArg" id="nameArg" value="valueArg" size="10" maxlength="10" key1="value1" key2="value2" />

attributes is used to generate additional attributes for the label tag. IDictionary.Keys are used to name attributes. IDictionary.Values are used to assign those attributes values.

public InputText ( String name, String value, int size, int maxlength, IDictionary attributes ) : String
name String Value for name and id attributes.
value String for value attribute.
size int size attribute value.
maxlength int maxlength attribute value.
attributes IDictionary Additional attributes for the input tag.
Résultat String

LabelFor() public méthode

Creates a label for the element indicated with forId. <label for="forIdArg">labelArg</label>
Calling LabelFor( "forIdArg", "labelArg" ) results in: <label for="forIdArg">labelArg</label>
public LabelFor ( String forId, String label ) : String
forId String ID of the element for which to create the lable.
label String Label name.
Résultat String

LabelFor() public méthode

Creates a label for the element indicated with forId. <label key1="value1" key2="value2" for="forIdArg">labelArg</label>
Calling LabelFor( "forIdArg", "labelArg", IDictionary ) results in: <label key5="value5" key4="value4" key1="value1" key3="value3" key2="value2" for="forIdArg">labelArg</label>
public LabelFor ( String forId, String label, IDictionary attributes ) : String
forId String ID of the element for which to create the label.
label String Label name.
attributes IDictionary Additional attributes to add to the label.
Résultat String

Link() public méthode

Creates an anchor (link) to the target <a href="/sometarget.html">linkText</a>
Calling Link( "something.html", "to something" ) results in: <a href="something.html">something</a>
public Link ( String target, String linkText ) : String
target String link's target.
linkText String Text of the link.
Résultat String

Link() public méthode

Creates an anchor (link) to the target <a href="/sometarget.html">linkText</a>
Calling Link( "something.html", "to something", $DictHelper.CreateDict("class=mylinkclass") ) results in: <a href="something.html" class="mylinkclass">something</a>
public Link ( String target, String linkText, IDictionary attributes ) : String
target String link's target.
linkText String Text of the link.
attributes IDictionary Additional attributes for the a tag.
Résultat String

LinkTo() public méthode

Creates an anchor (link) to the action on the current controller. <a href="/website/currentController/actionArg.rails">nameArg</a>
Calling LinkTo( "nameArg", DictHelper.CreateDict("controller=home","action=index") ) results in: <a href="/websiter/home/index.rails">nameArg</a>
public LinkTo ( String name, IDictionary options ) : String
name String Name for the link.
options IDictionary link options
Résultat String

LinkTo() public méthode

Creates an anchor (link) to the action on the current controller. <a href="/website/currentController/actionArg.rails">nameArg</a>
Calling LinkTo( "nameArg", "actionArg" ) results in: <a href="/websiter/currentController/actionArg.rails">nameArg</a>
public LinkTo ( String name, String action ) : String
name String Name for the link.
action String Action to link to.
Résultat String

LinkTo() public méthode

Creates an anchor (link) to the action on the specified controller. <a href="/website/controllerArg/actionArg.rails">nameArg</a>
Calling LinkTo( "nameArg", options ) results in: <a href="/website/controllerArg/actionArg.rails">nameArg</a>
public LinkTo ( String name, String controller, String action ) : String
name String Name for the link.
controller String Controller to link to.
action String Action to link to.
Résultat String

LinkTo() public méthode

Creates an anchor (link) to the action on the specified controller passing provided id. <a href="/website/controllerArg/actionArg.rails?id=objectId">nameArg</a>
Calling LinkTo( "nameArg", "controllerArg", "actionArg", object ) results in: <a href="/website/controllerArg/actionArg.rails?id=object">nameArg</a>

String.Format(String, object) is used to convert id to the actual String.

public LinkTo ( String name, String controller, String action, object id ) : String
name String Name for the link.
controller String Controller to link to.
action String Action to link to.
id object Object to use for the action ID argument.
Résultat String

LinkToAttributed() public méthode

Creates an anchor (link) to the action on the specified controller <a href="/website/controllerArg/actionArg.rails">nameArg</a>
Calling LinkToAttributed( "nameArg", "controllerArg", "actionArg", IDictionary ) results in: <a href="/website/controllerArg/actionArg.rails">nameArg</a>
public LinkToAttributed ( String name, String controller, String action, IDictionary attributes ) : String
name String Name for the link.
controller String Controller to link to.
action String Action to link to.
attributes IDictionary Additional attributes for the a tag.
Résultat String

LinkToAttributed() public méthode

Creates an anchor (link) to the action on the specified controller <a href="/website/controllerArg/actionArg.rails?id=x">nameArg</a>
Calling LinkToAttributed( "nameArg", "controllerArg", "actionArg", IDictionary ) results in: <a href="/website/controllerArg/actionArg.rails">nameArg</a>
public LinkToAttributed ( String name, String controller, String action, object id, IDictionary attributes ) : String
name String Name for the link.
controller String Controller to link to.
action String Action to link to.
id object The ID to be passed as a parameter for the action
attributes IDictionary Additional attributes for the a tag.
Résultat String

LinkToWithPost() public méthode

Creates an anchor (link) to the action on the current controller that posts using a hidden form element.
public LinkToWithPost ( String name, String action ) : String
name String Name for the link.
action String Action to link to on the current controller.
Résultat String

LinkToWithPost() public méthode

Creates an anchor (link) to the action on the current controller that posts using a hidden form element.
public LinkToWithPost ( String name, String action, String confirm ) : String
name String Name for the link.
action String Action to link to on the current controller.
confirm String Guards the form submission with a javascript confirm popup.
Résultat String

LinkToWithPost() public méthode

Creates an anchor (link) to the action on the specified controller that posts using a hidden form element.
public LinkToWithPost ( String name, String controller, String action, String confirm ) : String
name String Name for the link.
controller String Controller to link to.
action String Action to link to.
confirm String Guards the form submission with a javascript confirm popup.
Résultat String

LinkToWithPost() public méthode

Creates an anchor (link) to the action on the specified controller that posts using a hidden form element.
public LinkToWithPost ( String name, String controller, String action, object id ) : String
name String Name for the link.
controller String Controller to link to.
action String Action to link to.
id object The ID to be passed as a parameter for the action.
Résultat String

LinkToWithPost() public méthode

Creates an anchor (link) to the action on the specified controller that posts using a hidden form element.
public LinkToWithPost ( String name, String controller, String action, object id, String confirm ) : String
name String Name for the link.
controller String Controller to link to.
action String Action to link to.
id object The ID to be passed as a parameter for the action.
confirm String Guards the form submission with a javascript confirm popup.
Résultat String

LinkToWithPost() public méthode

Creates an anchor (link) to the action on the current controller that posts using a hidden form element.
public LinkToWithPost ( String name, String action, object id ) : String
name String Name for the link.
action String Action to link to on the current controller.
id object The ID to be passed as a parameter for the action.
Résultat String

LinkToWithPost() public méthode

Creates an anchor (link) to the action on the current controller that posts using a hidden form element.
public LinkToWithPost ( String name, String action, object id, string confirm ) : String
name String Name for the link.
action String Action to link to on the current controller.
id object The ID to be passed as a parameter for the action.
confirm string Guards the form submission with a javascript confirm popup.
Résultat String

LinkToWithPostAttributed() public méthode

Creates an anchor (link) to the action on the specified controller that posts using a hidden form element.
public LinkToWithPostAttributed ( String name, String controller, String action, String confirm, IDictionary attributes ) : String
name String Name for the link.
controller String Controller to link to.
action String Action to link to.
confirm String Guards the form submission with a javascript confirm popup.
attributes IDictionary Additional attributes for the a tag.
Résultat String

LinkToWithPostAttributed() public méthode

Creates an anchor (link) to the action on the specified controller that posts using a hidden form element.
public LinkToWithPostAttributed ( String name, String controller, String action, object id, String confirm, IDictionary attributes ) : String
name String Name for the link.
controller String Controller to link to.
action String Action to link to.
id object The ID to be passed as a parameter for the action.
confirm String Guards the form submission with a javascript confirm popup.
attributes IDictionary Additional attributes for the a tag.
Résultat String

MapToVirtual() public méthode

Maps target to website virtual path. /website/targetArg
Calling MapToVirtual( "targetArg" ) results in: /website/targetArg
public MapToVirtual ( String target ) : String
target String Target path to map.
Résultat String

OptionGroup() public méthode

Creates an opening optgroup element.
public OptionGroup ( String label ) : String
label String The label attribute.
Résultat String

Select() public méthode

Creates opening select tag. <select name="nameArg" id="nameArg">
Calling Select( "nameArg" ) results in: <select name="nameArg" id="nameArg">
public Select ( String name ) : String
name String Value for name and id attributes.
Résultat String

Select() public méthode

Creates opening select tag. <select name="nameArg" id="nameArg" key1="value1" key2="value2" >
Calling Select( "nameArg", IDictionary ) results in: <select name="nameArg" id="nameArg" key1="value1" key2="value2" >

attributes is used to generate additional attributes for the label tag. IDictionary.Keys are used to name attributes. IDictionary.Values are used to assign those attributes values.

public Select ( String name, IDictionary attributes ) : String
name String Value for name and id attributes.
attributes IDictionary Additional attributes for the select tag.
Résultat String

SubmitButton() public méthode

Creates a submit button. <input type="submit" value="valueArg" />
Calling SubmitButton( "valueArg" ) results in: <input type="submit" value="valueArg" />
public SubmitButton ( String value ) : String
value String for value attribute.
Résultat String

SubmitButton() public méthode

Creates a submit button. <input type="submit" value="valueArg" key1="value1" key2="value2" />
Calling SubmitButton( "valueArg", IDictionary ) results in: <input type="submit" value="valueArg" key1="value1" key2="value2" />

attributes is used to generate additional attributes for the label tag. IDictionary.Keys are used to name attributes. IDictionary.Values are used to assign those attributes values.

public SubmitButton ( String value, IDictionary attributes ) : String
value String for value attribute.
attributes IDictionary Additional attributes for the input tag.
Résultat String

TextArea() public méthode

Creates a text area element. <textarea id="nameArg" name="nameArg" cols="10" rows="10">valueArg</textarea>
Calling TextArea( "nameArg", 10, 10, "valueArg" ) results in: <textarea id="nameArg" name="nameArg" cols="10" rows="10">valueArg</textarea>
public TextArea ( String name, int cols, int rows, String value ) : String
name String Value for name and id attributes.
cols int cols attribute value.
rows int rows attribute value.
value String Text to place inside of the text area.
Résultat String