errormessage from two separate validators appearing in the same place
-
Hello! I´ve got a textbox where the user can write his/her email. I´ve got two validators pointing at this textbox, one asp:RequiredFieldValidator to make sure textbox is not empty and one asp:RegularExpressionValidator to make sure the email adress is correct (tried to use asp:RegularExpressionValidator but couldnt get it to work). My problem is to make the errors from these two validators showing in the same place. Right now it goes something like this:
[textbox for email ]
error1! error2!thanks!
-
Hello! I´ve got a textbox where the user can write his/her email. I´ve got two validators pointing at this textbox, one asp:RequiredFieldValidator to make sure textbox is not empty and one asp:RegularExpressionValidator to make sure the email adress is correct (tried to use asp:RegularExpressionValidator but couldnt get it to work). My problem is to make the errors from these two validators showing in the same place. Right now it goes something like this:
[textbox for email ]
error1! error2!thanks!
You can try setting the
Display
property toDynamic
. Example:<asp:RequiredFieldValidator ID="requiredEmailAddress" runat="server" ControlToValidate="txtEmailAddress" Display="Dynamic" CssClass="SomeClass"></asp:RequiredFieldValidator>
-- If this is a post that has been helpful to you, please vote for it. Thank you! "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." --Rich Cook
-
Hello! I´ve got a textbox where the user can write his/her email. I´ve got two validators pointing at this textbox, one asp:RequiredFieldValidator to make sure textbox is not empty and one asp:RegularExpressionValidator to make sure the email adress is correct (tried to use asp:RegularExpressionValidator but couldnt get it to work). My problem is to make the errors from these two validators showing in the same place. Right now it goes something like this:
[textbox for email ]
error1! error2!thanks!
Just Set the
**Display="Dynamic"**
for both the validation control By default it is static. You have to change to todynamic
. You can change i from code behind or from Validation control property itself. :)cheers, Abhijit CodeProject.Com MVP
-
Just Set the
**Display="Dynamic"**
for both the validation control By default it is static. You have to change to todynamic
. You can change i from code behind or from Validation control property itself. :)cheers, Abhijit CodeProject.Com MVP