Asp.net Validation Summary control



ValidationThe appropriate control is used to summarize all the verification errors on the page.

Following are main properties of the validation control.
ShowMessageBoxtrue/false. Popup alert box with all validation error, if true.
ShowSummarytrue/false. Display summary of all errors on the page, if true.
DisplayModeBulletList/List/SingleParagraph. Used to display all validation errors in specified format.
HeaderTextUsed to write the header of the error summary.
ValidationGroupThe input control is used to specify the group name for which the summary will be shown.
         
Example -
          
// Form & Validation Control /////////////////////////
<asp:Label ID="lbl" AssociatedControlID="TextBox1" runat="Server" Text="Write into TextBox"></asp:Label>
    <asp:TextBox ID="TextBox1" runat="Server"></asp:TextBox>
    <asp:RequiredFieldValidator ID="req1" runat="Server" ControlToValidate="TextBox1" ErrorMessage="1st TextBox is Mandatory field" Text="<br>Please write something in 1st  Box."></asp:RequiredFieldValidator>
    <asp:Button ID="btnSubmit" runat="Server" OnClick="WriteTextBoxValue" Text="Submit" />               
    <asp:ValidationSummary ID="ValidationSummary" runat="Server" ShowMessageBox="true" ShowSummary="true" DisplayMode="List" HeaderText="Following error occured." />


Share on Google Plus

About It E Research

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment