Hi Friends , Here I have Written a code for Ajax WaterMark
Control code in Asp.Net.
WaterMark.aspx:-
<%@
Page Language="C#" AutoEventWireup="true" CodeFile="WaterMarkControl.aspx.cs" Inherits="Ajax_WaterMarkControl"
%>
<%@
Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit"
tagprefix="asp"
%>
<!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></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label><asp:textbox ID="Textbox1"
runat="server"></asp:textbox>
<asp:TextBoxWatermarkExtender ID="Textbox1_TextBoxWatermarkExtender"
runat="server"
Enabled="True"
TargetControlID="Textbox1"
WatermarkText="UserName.......">
</asp:TextBoxWatermarkExtender>
</div>
</form>
</body>
</html>
Run this code and see the out. When you click a mouse on textbox then
text showing is invisible. If you will not write anything in this text and
click anywhere on the page hidden text will again appear. This is more simple
than JavaScript code.
No comments:
Post a Comment
Note: only a member of this blog may post a comment.