Jiya
Jiya

Reputation: 127

Validation summary is not working

I didn't get the "'*' - Required Field Can't Be Left Blank" as my output when I execute the form, eventhough I left the required textbox blank , please try to help me...

This is my validation summary code:

<asp:ValidationSummary ID="ValidationSummary1" 
     ForeColor="Red" HeaderText="'*' - Required Field Can't Be Left Blank" 
     EnableClientScript="true" runat="server" />

<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
           ControlToValidate="TextBox2" ErrorMessage="*" Display="Dynamic" ForeColor="Red" ValidationGroup="login"></asp:RequiredFieldValidator>

Upvotes: 1

Views: 2755

Answers (2)

Jignesh Jinjariya
Jignesh Jinjariya

Reputation: 31

Please try this below code in your page's head section. and please note that #ValidationSummary1 is Id of validation summary control. If you have provided other Id than this. place do change accordingly. this will display error summary without bullet-list.

<style type="text/css">
#ValidationSummary1 ul li
{
    list-style-type: none;
}
</style>

Upvotes: 0

Damith
Damith

Reputation: 63065

You need to have RequiredFieldValidator control to your textbox and then only ValidationSummary will show the result

If you using ValidationGroup for RequiredFieldValidator then you must give the same in ValidationSummary and the button as well

Upvotes: 1

Related Questions