Class HTMLBuilder
This class is used to group all the HTML helper methods that are available to help build up HTML to add using Addcontent.
public class HTMLBuilder
- Inheritance
-
HTMLBuilder
- Inherited Members
Methods
BlankRow()
Provides HTML to display a blank row in the standard CRM style. Must be used within a TABLE tag.
public string BlankRow()
Returns
- string
HTML for a blank row (string).
Box(string, string)
Returns HTML for a CRM style screen complete with title.
public string Box(string header, string content)
Parameters
headerstringCaption Code for the screen, translatable with "TabNames" family.
contentstringHTML content for the screen, should be result of an EntryGroup.GetEditHTML.. or EntryGroup.GetViewHTML.. or any complete <TABLE> tag.
Returns
- string
HTML string.
BoxContent(string, int, string, bool, bool, string)
Adds content to a box with more control over the layout.
public string BoxContent(string contentString, int cols, string boxClass, bool drawBottomBorder, bool drawTopBorder, string id)
Parameters
contentStringstringThe content to display within the box.
colsintNumber of colums.
boxClassstringClass to apply to the box content.
drawBottomBorderboolWhether to include the bottom border of the box.
drawTopBorderboolWhether to include the top border of the box.
idstringId value to be apply to box content so it can be referenced elsewhere.
Returns
- string
HTML string.
BoxContent(string)
Adds content to a box.
public string BoxContent(string contentString)
Parameters
contentStringstringThe content to display within the box.
Returns
- string
HTML string.
BoxTitle(string, string, bool, string, string)
Adds a clickable header with more control.
public string BoxTitle(string title, string url, bool showWideCaption, string id, string addToTitle)
Parameters
titlestringTitle code for the header, this will be translated with the "TabNames" family.
urlstringURL to redirect to when header is clicked.
showWideCaptionboolWhether to spread the title over more than 1 column.
idstringID to apply to the header so it can be referenced elsewhere.
addToTitlestringString value to be added to the right of title.
Returns
- string
HTML string.
BoxTitle(string, string, bool, string)
Adds a clickable header with more control.
public string BoxTitle(string title, string url, bool showWideCaption, string id)
Parameters
titlestringTitle code for the header, this will be translated with the "TabNames" family.
urlstringURL to redirect to when header is clicked.
showWideCaptionboolWhether to spread the title over more than 1 column.
idstringID to apply to the header so it can be referenced elsewhere.
Returns
- string
HTML string.
BoxTitle(string, string)
Adds a clickable header.
public string BoxTitle(string title, string url)
Parameters
titlestringTitle code for the header. This will be translated with the "TabNames" family.
urlstringURL to redirect to when header is clicked.
Returns
- string
HTML for the header.
BoxTitle(string)
Adds a header with a title.
public string BoxTitle(string title)
Parameters
titlestringTitle code for the header. This will be translated with the "TabNames" family.
Returns
- string
HTML for the header.
Div(string, string, string, string)
Low level method to get HTML for a <DIV> tag with extra control
public string Div(string divId, string divClass, string divContent, string extraControl)
Parameters
divIdstringThe ID to be applied to the <DIV> tag, by which it can be referenced.
divClassstringThe class to be applied to the <DIV>.
divContentstringThe content to be placed in the <DIV>.
extraControlstringExtra control settings that will be applied within the <DIV> tag eg STYLE="text-indent:25".
Returns
Div(string, string, string)
Low level method to get HTML for a <DIV> tag.
public string Div(string divId, string divClass, string divContent)
Parameters
divIdstringThe ID to be applied to the <DIV> tag, by which it can be referenced
divClassstringThe class to be applied to the <DIV>
divContentstringThe content to be placed in the <DIV>
Returns
EndTable()
Get HTML to end a <TABLE> tag.
public string EndTable()
Returns
Form()
Creates a form element with no action information.
public string Form()
Returns
Form(int, int)
Creates a form element with action information.
public string Form(int iAction, int iMode)
Parameters
Returns
GridBlank(int, int, string, string)
Fills out a grid with blank rows.
public string GridBlank(int rows, int cols, string class1, string class2)
Parameters
rowsintNumber of blank rows to add.
colsintNumber of colums in each row.
class1stringClass for the first blank row and every other row after that.
class2stringClass for the second blank row and every other row after that.
Returns
- string
HTML for blank rows.
GridData(string, string, string, string)
Writes out data to a CRM grid cell, specifying a JUMP url.
public string GridData(string value, string useclass, string jump, string width)
Parameters
Returns
GridData(string, string)
Writes out data to CRM grid cell, specifying a class to use.
public string GridData(string value, string useclass)
Parameters
Returns
GridData(string)
Writes out information to a CRM grid cell, using a string.
public string GridData(string value)
Parameters
valuestring
Returns
GridEnd()
Ends a CRM grid that has been manually built up with hGridXXX methods.
public string GridEnd()
Returns
- string
HTML to end a CRM grid.
GridHeader(string, bool, string)
Writes out header for a CRM grid columm, specifying a width.
public string GridHeader(string header, bool orderBy, string width)
Parameters
Returns
GridHeader(string, bool)
Writes out header for a CRM grid colum, allowing the grid to be sorted by this column.
public string GridHeader(string header, bool orderBy)
Parameters
Returns
GridHeader(string)
Writes out a header for a CRM grid column.
public string GridHeader(string header)
Parameters
headerstring
Returns
GridStart(string)
Starts a CRM grid with a title.
public string GridStart(string title)
Parameters
titlestringTitle to display on grid.
Returns
InputCheckBox(string, bool, string, string, bool, string, string)
Low level method to get HTML to display a check box, with more control.
public string InputCheckBox(string fieldName, bool isChecked, string onClick, string fieldValue, bool isDisabled, string content, string altValue)
Parameters
fieldNamestringName to be applied to check box.
isCheckedboolIf the check box is to be checked initially.
onClickstringJavascript to be applied to the onClick event.
fieldValuestringString to set as the value property of checkbox.
isDisabledboolWhether the checkbox is disabled.
contentstringExtra content to be put within a <LABLE> tag.
altValuestringText to show as the ALT value (when hovering over the checkbox).
Returns
- string
HTML string.
InputCheckBox(string, bool)
Low level method to get HTML to display a check box.
public string InputCheckBox(string fieldName, bool isChecked)
Parameters
fieldNamestringName to be applied to check box.
isCheckedboolWhether the check box is checked initially.
Returns
- string
HTML string.
InputHidden(string, string)
Gets HTML to add a hidden field to the page.
public string InputHidden(string fieldName, string fieldValue)
Parameters
Returns
- string
The HTML to draw a hidden field.
InputMultiText(string, string, int, int, string)
Low level method to get HTML to add a multi line text entry to the page.
public string InputMultiText(string fieldName, string fieldValue, int fieldWidth, int fieldHeight, string onChange)
Parameters
fieldNamestringField Name.
fieldValuestringInitial value.
fieldWidthintWidth of the text box (in characters).
fieldHeightintHeight of the text box (in rows).
onChangestringScript to be assigned to OnChange event.
Returns
InputPassword(string, string, int, int)
Low level method to get HTML to add a password entry field to the page.
public string InputPassword(string fieldName, string fieldValue, int maxChars, int fieldWidth)
Parameters
fieldNamestringField Name.
fieldValuestringInitial value.
maxCharsintMaximum number of characters that can be entered.
fieldWidthintPhysical size of field (in characters).
Returns
InputRadioButton(string, string, bool, string, bool, string)
Low level method to get HTML to display a radio button field.
public string InputRadioButton(string fieldName, string fieldValue, bool isChecked, string action, bool isDisabled, string extraContent)
Parameters
fieldNamestringField Name, all radio buttons within the same group should have the same field name.
fieldValuestringInitial value.
isCheckedboolWhether this radio button is checked, only one radio button within the group should have this set to True initially.
actionstringisDisabledboolWhether the button is disabled.
extraContentstringExtra content to be applied within the <INPUT< tag.
Returns
InputText(string, string, int, int, string, string, bool, string)
Low level method to get HTML to display a text entry field.
public string InputText(string fieldName, string fieldValue, int maxChars, int fieldWidth, string onClick, string onChange, bool isReadOnly, string extraContent)
Parameters
fieldNamestringField Name.
fieldValuestringInitial Value.
maxCharsintMaximum number of characters that can be entered.
fieldWidthintPhysical size of field (in characters).
onClickstringJavascript to be applied to the onClick event.
onChangestringJavascript to be applied to the onChange event.
isReadOnlyboolWhether the text box is readonly or not.
extraContentstringExtra content to be applied within the <INPUT< tag.
Returns
- string
HTML string.
InputText(string, string, int, int)
Low level method to get HTML to display a text entry field.
public string InputText(string fieldName, string fieldValue, int maxChars, int fieldWidth)
Parameters
fieldNamestringField Name.
fieldValuestringInitial Value.
maxCharsintMaximum number of characters that can be entered.
fieldWidthintPhysical size of field (in characters).
Returns
- string
HTML string.
Span(string, string, string)
Low level method to get HTML to draw a <SPAN> tag with extra control.
public string Span(string spanId, string spanContent, string extraControl)
Parameters
spanIdstringThe ID to be applied to the <SPAN> so it can be referenced elsewhere.
spanContentstringThe content to be place within the <SPAN> tag.
extraControlstringExtra that will be placed within the <SPAN> opening tag e.g.: STYLE="visibility:hidden".
Returns
- string
HTML string.
Span(string, string)
Low level method to get HTML to draw a <SPAN> tag.
public string Span(string spanId, string spanContent)
Parameters
spanIdstringThe ID to be applied to the <SPAN> so it can be referenced elsewhere.
spanContentstringThe content to be place within the <SPAN> tag.
Returns
- string
HTML string.
StartTable()
Get HTML to start a <TABLE>.
public string StartTable()
Returns
- string
HTML string.
Table(string, string)
Get HTML to draw a table in CRM style, with control over the style.
public string Table(string contentString, string tableClass)
Parameters
contentStringstringThe content to go within the <TABLE> tag.
tableClassstringThe CRM Style to apply to the table.
Returns
- string
HTML string.
Table(string)
Provides HTML that draws a table in standard CRM style.
public string Table(string contentString)
Parameters
contentStringstringValue to be placed inside the <TABLE> tag.
Returns
- string
HTML for a <table>.
TableData(string, Styles)
Gets HTML for a <TD> tag, specifying the CRM style to apply.
public string TableData(string contentString, Styles tdClass)
Parameters
Returns
- string
HTML for a <TD> tag.
TableData(string, string, string)
Gets HTML for a <TD> tag, with extra control.
public string TableData(string contentString, string tdClass, string extraControl)
Parameters
contentStringstringContent to display within the <TD> tag.
tdClassstringCRM style to apply.
extraControlstringExtra settings that will be place within the start of the <TD> tag eg 'COLSPAN=2'.
Returns
- string
HTML for a <TD> tag.
TableData(string, string)
Gets HTML for a <TD> tag, specifying the CRM style to apply.
public string TableData(string contentString, string tdClass)
Parameters
Returns
- string
HTML for a <TD> tag.
TableData(string)
Provides HTML for a <TD> tag.
public string TableData(string contentString)
Parameters
contentStringstringContent to display within the <TD> tag.
Returns
- string
HTML for a <TD> tag.
TableRow(string, Styles)
Low level method to get HTML for a single table row in CRM style, specifying the CRM style.
public string TableRow(string contentString, Styles trClass)
Parameters
Returns
TableRow(string, string)
Low level method to get HTML for a single table row in CRM style, specifying the CRM style.
public string TableRow(string contentString, string trClass)
Parameters
Returns
TableRow(string)
Gets HTML for a single table row in CRM style.
public string TableRow(string contentString)
Parameters
contentStringstringValue to go in the <TR> tag.
Returns
- string
HTML for a row.
UrlRoot()
Returns the root URL.
public string UrlRoot()
Returns
- string
Root URL.