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
header
stringCaption Code for the screen, translatable with "TabNames" family.
content
stringHTML 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
contentString
stringThe content to display within the box.
cols
intNumber of colums.
boxClass
stringClass to apply to the box content.
drawBottomBorder
boolWhether to include the bottom border of the box.
drawTopBorder
boolWhether to include the top border of the box.
id
stringId 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
contentString
stringThe 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
title
stringTitle code for the header, this will be translated with the "TabNames" family.
url
stringURL to redirect to when header is clicked.
showWideCaption
boolWhether to spread the title over more than 1 column.
id
stringID to apply to the header so it can be referenced elsewhere.
addToTitle
stringString 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
title
stringTitle code for the header, this will be translated with the "TabNames" family.
url
stringURL to redirect to when header is clicked.
showWideCaption
boolWhether to spread the title over more than 1 column.
id
stringID 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
title
stringTitle code for the header. This will be translated with the "TabNames" family.
url
stringURL 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
title
stringTitle 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
divId
stringThe ID to be applied to the <DIV> tag, by which it can be referenced.
divClass
stringThe class to be applied to the <DIV>.
divContent
stringThe content to be placed in the <DIV>.
extraControl
stringExtra 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
divId
stringThe ID to be applied to the <DIV> tag, by which it can be referenced
divClass
stringThe class to be applied to the <DIV>
divContent
stringThe 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
rows
intNumber of blank rows to add.
cols
intNumber of colums in each row.
class1
stringClass for the first blank row and every other row after that.
class2
stringClass 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
value
string
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
header
string
Returns
GridStart(string)
Starts a CRM grid with a title.
public string GridStart(string title)
Parameters
title
stringTitle 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
fieldName
stringName to be applied to check box.
isChecked
boolIf the check box is to be checked initially.
onClick
stringJavascript to be applied to the onClick event.
fieldValue
stringString to set as the value property of checkbox.
isDisabled
boolWhether the checkbox is disabled.
content
stringExtra content to be put within a <LABLE> tag.
altValue
stringText 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
fieldName
stringName to be applied to check box.
isChecked
boolWhether 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
fieldName
stringField Name.
fieldValue
stringInitial value.
fieldWidth
intWidth of the text box (in characters).
fieldHeight
intHeight of the text box (in rows).
onChange
stringScript 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
fieldName
stringField Name.
fieldValue
stringInitial value.
maxChars
intMaximum number of characters that can be entered.
fieldWidth
intPhysical 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
fieldName
stringField Name, all radio buttons within the same group should have the same field name.
fieldValue
stringInitial value.
isChecked
boolWhether this radio button is checked, only one radio button within the group should have this set to True initially.
action
stringisDisabled
boolWhether the button is disabled.
extraContent
stringExtra 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
fieldName
stringField Name.
fieldValue
stringInitial Value.
maxChars
intMaximum number of characters that can be entered.
fieldWidth
intPhysical size of field (in characters).
onClick
stringJavascript to be applied to the onClick event.
onChange
stringJavascript to be applied to the onChange event.
isReadOnly
boolWhether the text box is readonly or not.
extraContent
stringExtra 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
fieldName
stringField Name.
fieldValue
stringInitial Value.
maxChars
intMaximum number of characters that can be entered.
fieldWidth
intPhysical 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
spanId
stringThe ID to be applied to the <SPAN> so it can be referenced elsewhere.
spanContent
stringThe content to be place within the <SPAN> tag.
extraControl
stringExtra 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
spanId
stringThe ID to be applied to the <SPAN> so it can be referenced elsewhere.
spanContent
stringThe 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
contentString
stringThe content to go within the <TABLE> tag.
tableClass
stringThe 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
contentString
stringValue 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
contentString
stringContent to display within the <TD> tag.
tdClass
stringCRM style to apply.
extraControl
stringExtra 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
contentString
stringContent 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
contentString
stringValue to go in the <TR> tag.
Returns
- string
HTML for a row.
UrlRoot()
Returns the root URL.
public string UrlRoot()
Returns
- string
Root URL.