Saturday, March 10, 2012

Watermark Textbox ASP.NET AJAX Extension


This program is for Watermark text field. Copy below code into an AJAX enable website.




<%@ Page Language="C#" AutoEventWireup="true" CodeFile="watermerk_text.aspx.cs" Inherits="_Default" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

<!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>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        Enter name:-<asp:TextBox ID="TextBox1" runat="server" BackColor="#C0C0FF"></asp:TextBox>
       
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
       
        <cc1:textboxwatermarkextender id="TextBoxWatermarkExtender1" runat="server"
        TargetControlID="TextBox1"
        WatermarkText="Write first and last name"
        WatermarkCssClass="watermarked"
        >
        </cc1:textboxwatermarkextender>
  
    </div>
    </form>
</body>
</html>

No comments:

Post a Comment