anchor causes asp:requiredfieldvalidator to light up

G

Guest

I have a text box that is validated using an asp:requiredfieldvalidator.
There is an asp button control that posts back to the server. When the button
is pressed, if there is no data in the text box then the
asp:requiredfieldvalidator message lights up as expected and prevents post
back. This works as expected.

However, I also have an anchor link on the pages such as <a href="#" onclick
= "MyPostBackJavaScript" />

When this link is pressed, the page posts back as expected, however, on
return the asp:requiredfieldvalidator is lit. If I put text in the textbox
then click the link, the asp:requiredfieldvalidator won't light up.

The anchor link should not cause validation at all. Can someone tell me what
might be going on here?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top