Categories
Asp, Asp.net

Validation Summary Show Message Box Only, NO Display Summary

Validation Summary Show Message Box Only, NO Display Summary

Hi friends, in this post we discussed how to show Validation Summary Show Message Box Only, NO Display Summary. In this we will display all validation errors on message pop-up box, no validation summary will be displayed. This is very useful and only required combination of  false, true for two attribute of validation summary tag.

In earlier post we had discussed about Ajax AutoComplete Extender Example In Asp.NetAjax Collapsible Panel Extender Example In Asp.NetAllow Only Numbers in Textbox in Asp.netAjax ModalPopUp Extender Example In Asp.Net.

We got is done by making  ShowSummary=”false” and   ShowMessageBox=”true”.

Code:

<div>
<asp:TextBox runat="server" class="form-control" ID="pcode" placeholder="Pin Code" aria-describedby="basic-addon16"></asp:TextBox>
<asp:RequiredFieldValidator ID="rv6" ValidationGroup="vg"  ControlToValidate="pcode" runat="server" Display="None" ErrorMessage="Pin Code Required"></asp:RequiredFieldValidator>

<asp:ValidationSummary ID="vsum1" runat="server" ValidationGroup="vg" DisplayMode="List" ShowSummary="false" ForeColor="Red" ShowMessageBox="true"  />

<asp:Button ID="Button2" CssClass="btn btn-success" Text="Create My Account" ValidationGroup="vg" OnClick="Button2_Click" runat="server" />
</div>