Click or drag to resize
KaxInputControlEmptyMessage Property
Gets or sets a value message shown when the control is empty.

Namespace: Kettic.AspNet.Controls
Assembly: Kettic.AspNet.Controls (in Kettic.AspNet.Controls.dll) Version: 2014.4.1129.0 (2014.04.1129.0)
Syntax
public virtual string EmptyMessage { get; set; }

Property Value

Type: String
A string specifying the empty message. The default value is empty string. ("").
Remarks
Shown when the control is empty and loses focus. You can set the empty message text through EmptyMessage property.
Examples

The following code example demonstrates how to set an empty message in code behind:

[C#]

            </%@ Page Language="C#" /%>  
</%@ Register Assembly="KaxInput.Net2" Namespace="Kettic.AspNetControls" TagPrefix="kaxI" /%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
<script runat="server">
protected void Button1_Click(object sender, EventArgs e)
{
KaxNumericTextBox1.EmptyMessage = KaxNumericTextBox1.Text;
KaxNumericTextBox1.Text = String.Empty;
}
</script>
</head>
<body>
<form id="form1" runat="server">
<kaxI:KaxTextBox EmptyMessage="Type Here" ID="KaxNumericTextBox1" runat="server">
</kaxI:KaxTextBox>
<asp:Button ID="Button1" runat="server" Text="Set Empty Message" OnClick="Button1_Click" />
</form>
</body>
</html>

[Visual Basic]

            </%@ Page Language="VB" /%>
</%@ Register Assembly="KaxInput.Net2" Namespace="Kettic.AspNetControls" TagPrefix="kaxI" /%>
<!DOCTYPE html Public "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>Untitled Page</title>
<script runat="server">
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
KaxNumericTextBox1.EmptyMessage = KaxNumericTextBox1.Text
KaxNumericTextBox1.Text = String.Empty
End Sub
</script>
</head>
<body>
<form id="form1" runat="server">
<kaxI:KaxTextBox EmptyMessage="Type Here" ID="KaxNumericTextBox1" runat="server">
</kaxI:KaxTextBox>
<asp:Button ID="Button1" runat="server" Text="Set Empty Message" />
</form>
</body>
</html>
See Also