Click or drag to resize
HTMLHelper Class
HTML utility methods.
Inheritance Hierarchy
SystemObject
  CMS.HelpersHTMLHelper

Namespace: CMS.Helpers
Assembly: CMS.Helpers (in CMS.Helpers.dll) Version: 10.0.0
Syntax
C#
public static class HTMLHelper

The HTMLHelper type exposes the following members.

Fields
  NameDescription
Public fieldStatic memberDEFAULT_XMLNS_ATTRIBUTE
XMLNS attribute used in XHTML documents.
Public fieldStatic memberDIVS
CSS class marker to enable conversion of TABLE to DIV
Public fieldStatic memberDOCTYPE_HTML5
HTML 5 document type.
Public fieldStatic memberHTML_BREAK
HTML break tag - "<br />".
Public fieldStatic memberNO_DIVS
CSS class marker to disable conversion of TABLE to DIV
Top
Properties
  NameDescription
Public propertyStatic memberQuickResolveUrls
If true, quick mode is used for resolving of the URLs.
Public propertyStatic memberRegExFixAJAXFormAction
Regular expression to fix the form action parameter for AJAX request.
Public propertyStatic memberRegExFixFormAction
Regular expression to fix the form action parameter.
Public propertyStatic memberRegExHTMLEncode
Regular expression for HTML encoding.
Public propertyStatic memberRegexHtmlToTextHead
Regular expression for removing entire head tag.
Public propertyStatic memberRegexHtmlToTextScript
Regular expression for removing entire script tag.
Public propertyStatic memberRegexHtmlToTextStyle
Regular expression for removing entire script tag.
Public propertyStatic memberRegexHtmlToTextTags
Regular expression for removing tags but keeps their content.
Public propertyStatic memberRegexHtmlToTextWhiteSpace
Regular expression for removing white spaces
Public propertyStatic memberRegExLineEnd Obsolete.
Regular expression match for the end of the line.
Public propertyStatic memberRegExResolveUrls
Regular expression for URL resolving.
Public propertyStatic memberRegExStripTagsSpaces
Regular expression match for new lines and spaces between tags.
Top
Methods
  NameDescription
Public methodStatic memberEncodeForHtmlAttribute
Encodes string to be used as the HTML attribute value.
Public methodStatic memberEncodeForHtmlComment
Encodes string to be used in a HTML comment.
Public methodStatic memberEnsureHtmlLineEndings
Ensures the HTML line endings (<br />) in the given text.
Public methodStatic memberEnsureLineEnding Obsolete.
Ensures proper line ending within the given string.
Public methodStatic memberEnsureURLPrefixes
Ensures that all local URLs have given prefix
Public methodStatic memberFixFormAction
Fixes the form action attribute within given HTML code.
Public methodStatic memberFixRTLText
Fixes RTL text. Adds special marks at the end (at the beginning) of the text if it ends (starts) with weak unicode symbol.
Public methodStatic memberFixUrl
Fixes the URL within given HTML code. The output code is HTML valid. It changes '&' to '&amp;' and backwards if needed. '?test=1&test2=2' is changed to '?test=1&amp;test2=2' '&amp;#13;' is changed to '&#13;'. '&amp;lt;' is changed to '&lt;'.
Public methodStatic memberFixViewstate
Fixes the view state tag within given HTML code.
Public methodStatic memberFixXHTML
Performs the HTML code fix to become valid XHTML. Method for complete fix solution.
Public methodStatic memberGetAttributeValue
Gets the value of the HTML element's attribute.
Public methodStatic memberGetConvertTableEnum
Converts the string representation to the ConvertTableEnum
Public methodStatic memberGetFormAction
Gets the form action for the current request.
Public methodStatic memberGetLink
Returns the HTML link element that links to a related document.
Public methodStatic memberGetSafeColorFromHtml
Returns color from HTML string color definition.
Public methodStatic memberGetUniqueControlID
Gets the unique ID for the control, if some other control has the same base ID, adds the number at the end.
Public methodStatic memberHighlightHTML
Highlight HTML.
Public methodStatic memberHTMLDecode
HTML decoding function. Returns a string converted into an HTML-decoded string.
Public methodStatic memberHTMLEncode
HTML encoding function. Returns a string converted into an HTML-encoded string. Function does not encode previously encoded HTML entity (avoiding double HTML escaping).
Public methodStatic memberHTMLEncodeLineBreaks
HTML encoding function. HTML encodes given text and replaces standard line breaks with "<br />" tag.
Public methodStatic memberHtmlToPlainText
Converts HTML to the plain text (body part).
Public methodStatic memberLimitLength
Limits the string length.
Public methodStatic memberReformatHTML
Reformats the HTML code indentation.
Public methodStatic memberRemoveFormName
Removes form name tag from the given HTML code.
Public methodStatic memberRemoveScripts
Removes the scripts from the given HTML text.
Public methodStatic memberRemoveTitleId
Removes the title ID attribute from the HTML code.
Public methodStatic memberReplaceTagParameter(String, String, String)
Replaces an attribute of a specified name inside an HTML element.
Public methodStatic memberReplaceTagParameter(String, String, MatchEvaluator)
Replaces an attribute of a specified name inside an HTML element.
Public methodStatic memberResolveCSSClientUrls
Resolves client-relative URLs in CSS rules to absolute URLs (used with css files).
Public methodStatic memberResolveCSSUrls
Resolves application-relative URLs in CSS rules to absolute URLs (used with database style sheets).
Public methodStatic memberResolveUrls
Resolves relative URLs in given HTML(string). If CMSResolveAllUrls application settings is true it resolves all URLs. Otherwise it resolves URLs used in "src" or "href" or "background" attributes.
Public methodStatic memberSpanMsg
Returns span (of specified CSS class) containing message.
Public methodStatic memberStripTags(String, Boolean, String)
Remove HTML tags from text.
Public methodStatic memberStripTags(String, Boolean, Boolean, String, String, String)
Remove HTML tags from text.
Public methodStatic memberUnResolveUrls
Unresolve relative URI if used in "src=" or "href=" or "background=" or "url(".
Public methodStatic memberUseNoFollowForUsersLinks
Returns true if rel="nofollow" should be used for users link in forums, blog comments or message boards
Top
See Also