473,320 Members | 1,856 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,320 software developers and data experts.

Checking IsValid in the web form

Hi

If I use the client side validation control, do I need to check for IsValid
on the server side? if yes then why?
Thanks
Nov 18 '05 #1
4 1218
Yes since you cannot be certain that client-side validation will be
executed. Some examples of when this might happen:

1. Client browser does not support the validation code.
2. Client browser has javascript disabled.
3. Post to the form comes from outside your application.

Any of these might be due to either "innocent" and valid client behaviour.
However, you should also be protecting yourself against malicious attempts
to hack your application, which can use any of the above mechanisms as well
in order to deliberately bypass client-side validation.

HTH,
Nicole
"R.A." <te**@hotmail.com> wrote in message
news:ek**************@TK2MSFTNGP09.phx.gbl...
Hi

If I use the client side validation control, do I need to check for
IsValid
on the server side? if yes then why?
Thanks

Nov 18 '05 #2
Definitely.
#1: There's no guarantee the client-side stuff wasn't bypassed or otherwise didn't work. It's
pretty trivial to get around Javascript validation if you want to; I've done it a number of times
myself simply because the page's validation code was broken but I needed to use the form anyways.

R.A. wrote:
Hi

If I use the client side validation control, do I need to check for IsValid
on the server side? if yes then why?
Thanks


Nov 18 '05 #3
Should I call Page.Validate before checking IsValid?
"Nicole Calinoiu" <ni*****@somewhere.net> wrote in message
news:uQ**************@TK2MSFTNGP09.phx.gbl...
Yes since you cannot be certain that client-side validation will be
executed. Some examples of when this might happen:

1. Client browser does not support the validation code.
2. Client browser has javascript disabled.
3. Post to the form comes from outside your application.

Any of these might be due to either "innocent" and valid client behaviour.
However, you should also be protecting yourself against malicious attempts to hack your application, which can use any of the above mechanisms as well in order to deliberately bypass client-side validation.

HTH,
Nicole
"R.A." <te**@hotmail.com> wrote in message
news:ek**************@TK2MSFTNGP09.phx.gbl...
Hi

If I use the client side validation control, do I need to check for
IsValid
on the server side? if yes then why?
Thanks


Nov 18 '05 #4
Yes. The validators are not polled until you call the Validate method. The
requirement to call Validate before IsValid is mentioned in the
documentation for the IsValid property.
"R.A." <te**@hotmail.com> wrote in message
news:eT**************@TK2MSFTNGP10.phx.gbl...
Should I call Page.Validate before checking IsValid?
"Nicole Calinoiu" <ni*****@somewhere.net> wrote in message
news:uQ**************@TK2MSFTNGP09.phx.gbl...
Yes since you cannot be certain that client-side validation will be
executed. Some examples of when this might happen:

1. Client browser does not support the validation code.
2. Client browser has javascript disabled.
3. Post to the form comes from outside your application.

Any of these might be due to either "innocent" and valid client
behaviour.
However, you should also be protecting yourself against malicious

attempts
to hack your application, which can use any of the above mechanisms as

well
in order to deliberately bypass client-side validation.

HTH,
Nicole
"R.A." <te**@hotmail.com> wrote in message
news:ek**************@TK2MSFTNGP09.phx.gbl...
> Hi
>
> If I use the client side validation control, do I need to check for
> IsValid
> on the server side? if yes then why?
>
>
> Thanks
>
>



Nov 18 '05 #5

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

Similar topics

2
by: Paul Tomlinson | last post by:
The keyword new is required on 'B.IsValid' because it hides inherited member 'A.IsValid' All I have a couple of classes which resemble (sort of!) this: public class A { public bool bIsValid =...
9
by: booksnore | last post by:
I am writing some code to search for strings that contain every letter of the alphabet. At the moment I am using the method below to check to see if a string contains every letter of the alphabet....
0
by: Mike P | last post by:
I have a form with a Serial No and Pin text box which are validated with required field validators. Once they are validated my code goes to a btn_Click event and if Page.IsValid then checks to see...
4
by: Emilio | last post by:
Hi, I have a form that contains various server validation controls, the submit button will either open a popup box or a popup window on the client-side click event. The question is, how do I...
3
by: The Other Mike | last post by:
In my existing Powerbuilder application I have several statements that check to make sure an object is instatiated. ie. If isvalid(form1) then.... Is there a way to check for this in VB.NET?...
1
by: gryffin | last post by:
im trying to do file extension checking but its not working :( i have the following in the head <script language="JavaScript"> extArray = new Array(".jpg", ".png", ".bmp"); function...
1
by: =?Utf-8?B?SGF3aw==?= | last post by:
Hello, I have been trying to get a duplicate field checker to work within my gridview using a custom validator. However with the code I have I am getting an error error: Object reference not...
3
by: Andrew Jocelyn | last post by:
Hi I have couple of dropdown controls each with a requiredfieldvalidator. I clear the dropdownlist in the button click event. When the page is rendered the dropdown validator already flags it's...
2
by: =?Utf-8?B?R2FyeSBMYXJpbWVy?= | last post by:
I an asp.net web page with a simple form and a Submit button. Form entries are validated client side, but as a back up I would also like to validate server side, but not sure where to do it code....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.