Use of ValidatorCalloutExtender in asp3.5

Asp 2.0 provide use various validation controls such as required field validator,range validator, summary validator, regular expression validation.
As Ajax components are more advance than asp 2.0 control
here ajax provide validator callout extendefr control
it is used to check the validity of the control
Apart from this the messge shown is just like tooltip.
which we can design urself by specifying the error messge, warning icon,close icon,
backgroung color,we can even create our own css just for defining the look of the tooltip


How To use:

In the Source code window type:

 <form id="form1" runat="server">

    <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
    </asp:ToolkitScriptManager>

   Name: <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
    <asp:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" TargetControlID="RequiredFieldValidator1"   runat="server">
    </asp:ValidatorCalloutExtender>

    <asp:RequiredFieldValidator  Display="None" ID="RequiredFieldValidator1" runat="server"  ControlToValidate="TextBox1" ErrorMessage="User Name cannt be left blank"></asp:RequiredFieldValidator>

   Password:<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox> 

    <asp:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" TargetControlID="RequiredFieldValidator2"  runat="server">
    </asp:ValidatorCalloutExtender>

  <asp:RequiredFieldValidator ID="RequiredFieldValidator2"  Display="None" runat="server"  ControlToValidate="TextBox2" ErrorMessage="Passwordcannt be left blank"></asp:RequiredFieldValidator>

   <asp:Button ID="b" runat="server" Text="Login" />

    </form>


Here is the Code and its works .
Firstly just make your login control
I had used 2 required field validator which are bounded with 2 textboxs(Userid,Password)

Again the VallidCallout Extender uses the TargerControlId of the required field validator.

Note: Target Control Id of the vallidatorCallout Extendor should be the required validation control .it should not be the textboxs id and also Diplay property of the required field validator should be specified


Next Recommended Reading Custom Alert Message using Ajax