Preventing Validation

T

tshad

I have a logon page that asks for a Logon and Password as well as a
linkbutton that goes to register a new user.

The problem is that if I push the submit button or the linkbutton to
register a new user, it jumps to the validation routine before anything
else. If a user fills in an email and password and then decides to press
the linkbutton to register, it will validate the logon and password and then
go to the register new user page.

Is there a way to prevent the the validation routine to not run or to only
have the submit button jump to the validation function?

Here is my RequiredFieldValidator:

<asp:RequiredFieldValidator
ControlToValidate="txtPassword"
Text="You must enter an password"
runat="server" />
<asp:CustomValidator
ControlToValidate="txtEmail"
OnServerVAlidate="ValidateEmail"
Display="Dynamic"
Text="Not Valid !"
runat="server" />

and my ValidateEmail starts out as:

Sub ValidateEmail(s as Object,e as ServerValidateEventArgs)

Thanks,

Tom
 
G

Guest

If you set the CausesValidation property of the control, (in this case your
linkbutton) to False, it won't trigger the RequiredFieldValidator. It is set
to True by default.
 
T

tshad

Richard said:
If you set the CausesValidation property of the control, (in this case
your
linkbutton) to False, it won't trigger the RequiredFieldValidator. It is
set
to True by default.
Perfect.

Thanks,

Tom
 

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,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top