473,386 Members | 1,757 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Preventing Validation

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
Nov 19 '05 #1
3 1303
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.

"tshad" wrote:
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

Nov 19 '05 #2
"Richard" <Ri*****@discussions.microsoft.com> wrote in message
news:15**********************************@microsof t.com...
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
"tshad" wrote:
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

Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Robb Meade | last post by:
Hi all, A recent project that I had finished and went live with no apparant problems. My client received an email from a user who mentioned that by accident they had been typing (over the...
10
by: bregent | last post by:
I've seen plenty of articles and utilities for preventing form injections for ASP.NET, but not too much for classic ASP. Are there any good input validation scripts that you use to avoid form...
0
by: kbrolin65 | last post by:
Hi, folks. Please be patient, as I am not a programmer. But I wasn't sure where to turn for advice except for a programming discussion group. I am an intermediate PC user--fairly knowledgeable,...
4
by: AD | last post by:
Hi, I have 2 different web pages, both using RequiredFieldValidator's, on the one page Postbacks are prevented when required fields are blank, on the other page the validators display the error...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.