Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

asp.net Regular Expression Validator with Required Field Validator

My problem is that i want to get the error on the same place.

<td>
   <asp:TextBox> ...</asp:TextBox>
   <br />
      <asp:RegularExpressionValidator 
          ErrorMessage=""please enter 9 digis only" ...>
      </asp:RegularExpressionValidator>
      <asp:RequiredFieldValidator 
          ErrorMessage="this can't be blank" ...>
      </asp:RequiredFieldValidator>
</td>

i attached an image with the output, look and the red messages this is the validators. i want that the error messages will be at the same place since just one error can be on. thanks for helpers (and for who tries).

the output of the code

like image 836
YaakovHatam Avatar asked Oct 29 '12 06:10

YaakovHatam


1 Answers

Add Display=Dynamic property to both the validators.

Further Reference

like image 127
Priyank Patel Avatar answered Nov 15 '22 00:11

Priyank Patel