ASP.Net Validators

G

Guest

I'm placing a ton of validators on a form where a user creates an account.
All I want to do is show the errors in the validation summary and not in each
individual control. I have a validation control set up already as well as
the field validators. How do I do this?

Thanks
Therese
 
T

Teemu Keiski

You should just have ValidationSummary control on the Page
(<asp:ValidationSummary runat="server" />) and then in each individual
validation control property/attribute Display="None" so that error messages
are not shown inline, only in the summary.

<asp:RequiredFieldValidator runat="server" ... Display="None"
ErrorMessage="Birthdate is required" />

You can also put it so that for example an asterisk (*) is shown inline
while error message is actual text. This happens so that set validation
control's ErrorMessage property/attribute to the text and between validation
control's beginning and end tags put *, for example:

<asp:RequiredFieldValidator runat="server" ... ErrorMessage="Birthdate is
required">*</asp:RequiredFieldValidator>

(here of course you wouldn't set Display to None)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Validators 1
Validators 3
Dynamic Validators 0
Validators 0
Trigger a Subset of Multiple Validators (Client-Side) 2
Dynamic Validators 0
ASP.NET Validators 5
validators not firing server-side 1

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top