Yes obviously, you have a very simple solution.
you don't have to use any jquery stuff. you just have to use asp:validationSummary
.
I'm posting here solution. with this you can show all error messages in simple popup by using standard asp validation controls
. It won't consume any space on your page
.
Have a look on code below:
<asp:ValidationSummary ID="validation1" runat="server" ShowMessageBox="true" ShowSummary="false" DisplayMode="SingleParagraph" ValidationGroup="abc" />
<asp:TextBox ID="txtAge" runat="server" ></asp:TextBox>
<asp:RequiredFieldValidator ID="req" runat="server" ControlToValidate="txtAge" Display="None" ValidationGroup="abc" ErrorMessage="Field Required"></asp:RequiredFieldValidator>
<asp:Button ID="btn" Text="click" runat="server" ValidationGroup="abc" />
Here i have set ShowMessageBox="true"
in Validation Summary
, which will show all error messages in popup.
Set your validators Display="none"
, so that the error messages display only in the popup.
the error message will look like below image. You don't have to worry about to manage space of page.
It is perfect , easy and simple solution for your problem.
Let me know, if it works for you.