i have a page where i am using validation summary and required field validators. When i click the validation button error message is being dispalyed in both validation summary is showing message written in required field validators. I want to display different message in validation summary and required field validators. e.g validation summary should display "field marked with * are mandatory" and required field validator should display only a "*".
Thanks
Set your validator's Text property to "*". This will be displayed at validator's text when validation fails, and the ErrorMessage will be displayed by the validation summary.
Pankaj try this code...
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
ErrorMessage="Error" ControlToValidate="TextBox1">*</asp:RequiredFieldValidator>
<br />
<asp:ValidationSummary ID="ValidationSummary1" runat="server"
DisplayMode="List" />
</div>
<asp:Button ID="Button1" runat="server" Text="Button" />
Here i have set the DisplayMode property of validation summary to List
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With