TextBoxWatermark控件,该控件用于当控件处于非焦点时的提示内容。
<%
@PageLanguage
=
"
C#
"
AutoEventWireup
=
"
true
"
CodeFile
=
"
TextboxWatermarkDemo.aspx.cs
"
Inherits = " TextboxWatermarkDemo " %>
<% @RegisterAssembly = " System.Web.Extensions,Version=1.0.61025.0,Culture=neutral,
PublicKeyToken=31bf3856ad364e35 "
Namespace = " System.Web.UI " TagPrefix = " asp " %>
<% @RegisterAssembly = " AjaxControlToolkit " Namespace = " AjaxControlToolkit " TagPrefix = " cc1 " %>
<! DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
< html xmlns ="http://www.w3.org/1999/xhtml" >
< head runat ="server" >
< title > 无标题页 </ title >
</ head >
< body >
< form id ="form1" runat ="server" >
< div >
< asp:ScriptManager ID ="ScriptManager1" runat ="server" >
</ asp:ScriptManager >
< asp:UpdatePanel ID ="UpdatePanel1" runat ="server" >
< ContentTemplate >
用户名:
< asp:TextBox ID ="TextBox1" CssClass ="unwatermarked" Width ="150" runat ="server" >
</ asp:TextBox >
< cc1:TextBoxWatermarkExtender ID ="TextBoxWatermarkExtender1" runat ="server"
TargetControlID ="TextBox1" WatermarkText ="请输入用户名" />
< br />
密码:
< asp:TextBox ID ="TextBox2" CssClass ="unwatermarked" Width ="150" runat ="server" >
</ asp:TextBox >
< cc1:TextBoxWatermarkExtender ID ="TextBoxWatermarkExtender2" runat ="server"
TargetControlID ="TextBox2" WatermarkText ="请输入密码" />
< br />
< br />
</ ContentTemplate >
</ asp:UpdatePanel >
</ div >
</ form >
</ body >
</ html >
Inherits = " TextboxWatermarkDemo " %>
<% @RegisterAssembly = " System.Web.Extensions,Version=1.0.61025.0,Culture=neutral,
PublicKeyToken=31bf3856ad364e35 "
Namespace = " System.Web.UI " TagPrefix = " asp " %>
<% @RegisterAssembly = " AjaxControlToolkit " Namespace = " AjaxControlToolkit " TagPrefix = " cc1 " %>
<! DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
< html xmlns ="http://www.w3.org/1999/xhtml" >
< head runat ="server" >
< title > 无标题页 </ title >
</ head >
< body >
< form id ="form1" runat ="server" >
< div >
< asp:ScriptManager ID ="ScriptManager1" runat ="server" >
</ asp:ScriptManager >
< asp:UpdatePanel ID ="UpdatePanel1" runat ="server" >
< ContentTemplate >
用户名:
< asp:TextBox ID ="TextBox1" CssClass ="unwatermarked" Width ="150" runat ="server" >
</ asp:TextBox >
< cc1:TextBoxWatermarkExtender ID ="TextBoxWatermarkExtender1" runat ="server"
TargetControlID ="TextBox1" WatermarkText ="请输入用户名" />
< br />
密码:
< asp:TextBox ID ="TextBox2" CssClass ="unwatermarked" Width ="150" runat ="server" >
</ asp:TextBox >
< cc1:TextBoxWatermarkExtender ID ="TextBoxWatermarkExtender2" runat ="server"
TargetControlID ="TextBox2" WatermarkText ="请输入密码" />
< br />
< br />
</ ContentTemplate >
</ asp:UpdatePanel >
</ div >
</ form >
</ body >
</ html >