Search This Blog

Thursday, December 27, 2012

How can use Ajax validation control on our form.


Select ValidatorCalloutExtender from Ajax control:



After adding  ValidatorCalloutExtender on form set property.
   <script language="javascript" type="text/javascript">
  </script>
 
   <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
    <asp:ValidatorCalloutExtender ID="reqCurPassword" runat="server" TargetControlID="curr_password">
    </asp:ValidatorCalloutExtender>
    <asp:ValidatorCalloutExtender ID="reqNewPassword" runat="server" TargetControlID="new_password">
    </asp:ValidatorCalloutExtender>
    <asp:ValidatorCalloutExtender ID="reqConfPassword" runat="server" TargetControlID="conf_password">
    </asp:ValidatorCalloutExtender>


Add .net RequiredFieldValidator on page:
<tr id="trBranch" runat="server">
        <td style="text-align: left; width: 188px;" class="text" >
        New Password :</td>

        <td style="text-align: left; ">
<asp:TextBox ID="txt_newpassword" runat="server" TabIndex="3" CssClass="TextBox" TextMode="Password"></asp:TextBox>

<asp:RequiredFieldValidator ID="new_password" runat="server"
ErrorMessage="Please enter new password." ToolTip="Please enter new password." ControlToValidate="txt_newpassword">*</asp:RequiredFieldValidator>

        </td>
    </tr>




Out put of Ajax validation control:


No comments :