Skip to content

TextBoxWatermarkExtender

MikhailTymchukDX edited this page Apr 12, 2017 · 3 revisions

Demo Page

TextBoxWatermark is an ASP.NET AJAX extender that can be attached to an ASP.NET TextBox control to get watermark behavior. When a watermarked TextBox is empty, it displays a message to a user with a custom CSS style. Once the user has typed text into the TextBox, the watermarked appearance disappears. The watermark is intended to provide more information to a user about the TextBox without cluttering up the rest of the page.

Properties

Name Description
WatermarkCssClass A CSS class to apply to the TextBox when it has no value (e.g. watermark text is shown)
WatermarkText Text to show when the control has no value

Client properties

Name Description
text Text of the target TextBox
watermarkCssClass A CSS class to apply to the TextBox when it has no value (e.g. watermark text is shown)
watermarkText Text to show when the control has no value

Client methods

Name Description
clearText(focusing) Clears the text from the target
registerPropertyChanged() A method to call to be assigned to Sys.Preview.UI.TextBox if any

Client properties

text

Text of the target TextBox

Getter name: get_text()
Setter name: set_text(value)

watermarkCssClass

A CSS class to apply to the TextBox when it has no value (e.g. watermark text is shown)

Getter name: get_watermarkCssClass()
Setter name: set_watermarkCssClass(value)

watermarkText

Text to show when the control has no value

Getter name: get_watermarkText()
Setter name: set_watermarkText(value)

Client methods

clearText(focusing)

Clears the text from the target

Params:

  • focusing
    • Type: Boolean
    • Description: Whether or not we are focusing on the textbox

registerPropertyChanged()

A method to call to be assigned to Sys.Preview.UI.TextBox if any

Remarks: This method must be called manually if Sys.Preview.UI.TextBox is added after TextBoxWatermarkBehavior is initialized

Clone this wiki locally