Thursday, March 15, 2012

TextBoxWatermark Extender example in Asp.Net c#



*************************************************************************

<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.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>TextBoxWatermark Extender example in Asp.Net c#</title>
    <style type="text/css">
    .watermark
    {
        color:#999999;
        font-style:italic;
    }
    .watermark:focus
    {
    border: solid 1px #fffa93;
    }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <div>
    <h2> TextBoxWatermark Extender example</h2>
    <p>
        <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
        <cc1:TextBoxWatermarkExtender
        ID="TextBox1_TextBoxWatermarkExtender"
        runat="server"
        Enabled="True"
        TargetControlID="TextBox1"
        WatermarkCssClass="watermark"
        WatermarkText="Enter your name here">
        </cc1:TextBoxWatermarkExtender>
    </p>
    <p>
        &nbsp;</p>
    </div>
    </form>
</body>
</html>


*************************************************************************

using System;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
}

Post a Comment