0

I'm doing a webform in .Net 3.5. I have a number of user controls on a page that have validation (mostly required fields) in the user controls. On the main page I have a validation summary.

The validation summary shows the errors correctly. The problem is when there's a field in a user control that is required and I fill it in, the validation message goes away but it still shows in the validation summary.

The code for the validation summary is:

    <asp:ValidationSummary ID="valSummary" runat="server" ShowSummary="true"
        DisplayMode="BulletList" CssClass="RequiredMessage" EnableClientScript="true"
        HeaderText="You must enter a value in the following fields:" />

The validation works correctly just appears as if in a user object it doesn't update unless a postback is done.

Is there something I need to add to the user object?

TIA - Jeff.

Jeff B
  • 535
  • 1
  • 6
  • 15
  • You say that 'validationsummary' doesnt change even when you fill in a textbox for example? So does this happen even after you click the submit button? – RelatedRhymes Apr 22 '15 at 08:15
  • If you click a button, or go through a field that has autopostback turned on, it's then correct. – Jeff B Apr 22 '15 at 12:19
  • Post the entire code here – RelatedRhymes Apr 23 '15 at 03:40
  • OK - I wonder if I'm missing something. I assume that because the validation disappears once the error is fixed (without a submit), does the validation summary go away also (without a submit) ? Or does it only go away on a submit? – Jeff B Apr 23 '15 at 13:04
  • After a little research, looks like validationsummary does not go away without a postback.You need to write some javascript to make it go away once there are no more validation errors on the page. – RelatedRhymes Apr 24 '15 at 06:16

1 Answers1

0

Try to add the same ValidationGroup (for example ValidationGroup="MyGroup") to all validation controls and ValidationSummary control.

PS. Please show the validation controls code.

фымышонок
  • 1,362
  • 16
  • 22
  • Do you mean the code that's in the user control? It's a normal RequiredFieldValidator control. If you want it, I can put in the entire code for the user control. – Jeff B Apr 22 '15 at 02:19