Tuesday, December 25, 2012

ASP.NET Validation Controls : Show Validation Message only on Validation Summary



One of my previous posts I have described how to use Validation summary on a web page. In case you need only to show the validation summary and hide any other validation text for individual controls, you can do the following.

Set the Display property to "None".

<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
                    ControlToValidate="txtName" ErrorMessage="Name Required"
                    ForeColor="#CC0000" Display="None" Text="*"></asp:RequiredFieldValidator>


No comments:
Write comments
Recommended Posts × +