How to use ValidatorCalloutExtender in asp.net ajax

Ajax ValidatorCalloutExtender - How to use ValidatorCalloutExtender in asp.net ajax
UsingValidatorCalloutExtender.aspx
<%@ Page Language="C#" AutoEventWireup="true" %>

<%@ 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">
<script runat="server">
    protected void Button1_Click(object sender, EventArgs e)
    {
        Label1.Text = "You submitted name: " + TextBox1.Text;
    }
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>Ajax ValidatorCalloutExtender - How to use ValidatorCalloutExtender in asp.net ajax</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <h2 style="color:Green; font-style:italic;">Ajax Control Toolkit Example: Using ValidatorCalloutExtender</h2>
        <hr width="575" align="left" color="LawnGreen" />
        <asp:ScriptManager 
            ID="ScriptManager1"
            runat="server"
            >
        </asp:ScriptManager>
        <cc1:ValidatorCalloutExtender 
            ID="ValidatorCalloutExtender1"
            runat="server"
            TargetControlID="RequiredFieldValidator1"
            >
        </cc1:ValidatorCalloutExtender>
        <asp:Label 
            ID="Label1"
            runat="server"
            ForeColor="Salmon"
            Font-Size="Large"
            Font-Names="Comic Sans MS"
            >
        </asp:Label>
        <br /><br />
        <asp:Label 
            ID="Label2"
            runat="server"
            Text="Name"
            Font-Bold="true"
            ForeColor="DeepPink"
            >
        </asp:Label>
        <asp:TextBox 
            ID="TextBox1"
            runat="server"
            >
        </asp:TextBox>
        <asp:RequiredFieldValidator 
            ID="RequiredFieldValidator1"
            runat="server"
            ControlToValidate="TextBox1"
            ErrorMessage="Input your name!"
            Display="None"
            >
        </asp:RequiredFieldValidator>
        <br /><br />
        <asp:Button 
            ID="Button1"
            runat="server"
            Text="Submit Name"
            Height="40"
            Font-Bold="true"
            ForeColor="DeepPink"
            OnClick="Button1_Click"
            />
    </div>
    </form>
</body>
</html>










Related asp.net example