Table of Contents

Class HTMLBuilder

Namespace
Sage.CRM.HTML
Assembly
SageCRMNet.dll

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 string

Caption Code for the screen, translatable with "TabNames" family.

content string

HTML 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 string

The content to display within the box.

cols int

Number of colums.

boxClass string

Class to apply to the box content.

drawBottomBorder bool

Whether to include the bottom border of the box.

drawTopBorder bool

Whether to include the top border of the box.

id string

Id 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 string

The 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 string

Title code for the header, this will be translated with the "TabNames" family.

url string

URL to redirect to when header is clicked.

showWideCaption bool

Whether to spread the title over more than 1 column.

id string

ID to apply to the header so it can be referenced elsewhere.

addToTitle string

String 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 string

Title code for the header, this will be translated with the "TabNames" family.

url string

URL to redirect to when header is clicked.

showWideCaption bool

Whether to spread the title over more than 1 column.

id string

ID 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 string

Title code for the header. This will be translated with the "TabNames" family.

url string

URL 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 string

Title 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 string

The ID to be applied to the <DIV> tag, by which it can be referenced.

divClass string

The class to be applied to the <DIV>.

divContent string

The content to be placed in the <DIV>.

extraControl string

Extra control settings that will be applied within the <DIV> tag eg STYLE="text-indent:25".

Returns

string

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 string

The ID to be applied to the <DIV> tag, by which it can be referenced

divClass string

The class to be applied to the <DIV>

divContent string

The content to be placed in the <DIV>

Returns

string

EndTable()

Get HTML to end a <TABLE> tag.

public string EndTable()

Returns

string

Form()

Creates a form element with no action information.

public string Form()

Returns

string

Form(int, int)

Creates a form element with action information.

public string Form(int iAction, int iMode)

Parameters

iAction int
iMode int

Returns

string

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 int

Number of blank rows to add.

cols int

Number of colums in each row.

class1 string

Class for the first blank row and every other row after that.

class2 string

Class 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

value string
useclass string
jump string
width string

Returns

string

GridData(string, string)

Writes out data to CRM grid cell, specifying a class to use.

public string GridData(string value, string useclass)

Parameters

value string
useclass string

Returns

string

GridData(string)

Writes out information to a CRM grid cell, using a string.

public string GridData(string value)

Parameters

value string

Returns

string

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

header string
orderBy bool
width string

Returns

string

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

header string
orderBy bool

Returns

string

GridHeader(string)

Writes out a header for a CRM grid column.

public string GridHeader(string header)

Parameters

header string

Returns

string

GridStart(string)

Starts a CRM grid with a title.

public string GridStart(string title)

Parameters

title string

Title to display on grid.

Returns

string

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 string

Name to be applied to check box.

isChecked bool

If the check box is to be checked initially.

onClick string

Javascript to be applied to the onClick event.

fieldValue string

String to set as the value property of checkbox.

isDisabled bool

Whether the checkbox is disabled.

content string

Extra content to be put within a <LABLE> tag.

altValue string

Text 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 string

Name to be applied to check box.

isChecked bool

Whether 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

fieldName string

Fieldname.

fieldValue string

Value.

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 string

Field Name.

fieldValue string

Initial value.

fieldWidth int

Width of the text box (in characters).

fieldHeight int

Height of the text box (in rows).

onChange string

Script to be assigned to OnChange event.

Returns

string

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 string

Field Name.

fieldValue string

Initial value.

maxChars int

Maximum number of characters that can be entered.

fieldWidth int

Physical size of field (in characters).

Returns

string

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 string

Field Name, all radio buttons within the same group should have the same field name.

fieldValue string

Initial value.

isChecked bool

Whether this radio button is checked, only one radio button within the group should have this set to True initially.

action string
isDisabled bool

Whether the button is disabled.

extraContent string

Extra content to be applied within the <INPUT< tag.

Returns

string

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 string

Field Name.

fieldValue string

Initial Value.

maxChars int

Maximum number of characters that can be entered.

fieldWidth int

Physical size of field (in characters).

onClick string

Javascript to be applied to the onClick event.

onChange string

Javascript to be applied to the onChange event.

isReadOnly bool

Whether the text box is readonly or not.

extraContent string

Extra 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 string

Field Name.

fieldValue string

Initial Value.

maxChars int

Maximum number of characters that can be entered.

fieldWidth int

Physical 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 string

The ID to be applied to the <SPAN> so it can be referenced elsewhere.

spanContent string

The content to be place within the <SPAN> tag.

extraControl string

Extra 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 string

The ID to be applied to the <SPAN> so it can be referenced elsewhere.

spanContent string

The 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 string

The content to go within the <TABLE> tag.

tableClass string

The 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 string

Value 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

contentString string

Content to display within the <TD> tag.

tdClass Styles

Sage.Styles.

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 string

Content to display within the <TD> tag.

tdClass string

CRM style to apply.

extraControl string

Extra 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

contentString string

Content to display within the <TD> tag.

tdClass string

CRM style to apply.

Returns

string

HTML for a <TD> tag.

TableData(string)

Provides HTML for a <TD> tag.

public string TableData(string contentString)

Parameters

contentString string

Content 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

contentString string

Value to go in the <TR> tag.

trClass Styles

Sage.Styles.

Returns

string

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

contentString string

Value to go in the <TR> tag.

trClass string

Returns

string

TableRow(string)

Gets HTML for a single table row in CRM style.

public string TableRow(string contentString)

Parameters

contentString string

Value to go in the <TR> tag.

Returns

string

HTML for a row.

UrlRoot()

Returns the root URL.

public string UrlRoot()

Returns

string

Root URL.