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

requiredFieldValidater and checking for null values

Is it a good idea to check for null/invalid values even though you have the
requiredFieldValidater doing it for you? or is that a little overboard?

Jun 27 '08 #1
2 848
Yes, it is a good idea, because it can be easy to forget to check the
IsValid property, and if a hacker for some reason decided to adjust your
code for the validator you would end up with an error. Validators are
intended to make the user interface more friendly for users while filling
out a form, they are not intended to be used as insurance that all values
are valid. However, keep in mind that many form controls (such as TextBox)
will never be null. It may have a Text property of zero length, but it's
still a String. A CheckBox is always True or False, one of the ListItems in
a DropDownList is always selected, etc. Hopefully this helps.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

"Andy B" <a_*****@sbcglobal.netwrote in message
news:ON**************@TK2MSFTNGP05.phx.gbl...
Is it a good idea to check for null/invalid values even though you have
the requiredFieldValidater doing it for you? or is that a little
overboard?

Jun 27 '08 #2
On 25 Apr, 17:28, "Andy B" <a_bo...@sbcglobal.netwrote:
Is it a good idea to check for null/invalid values even though you have the
requiredFieldValidater doing it for you? or is that a little overboard?
A RequiredFieldValidator only checks for an empty textbox or undefined
values. It does not check for valid content when it exists.

Other types of validator control can check for coherent content but in
a security critical application you may prefer to carry out further
verification using server-side code. Probably wise.
Jun 27 '08 #3

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

Similar topics

30
by: Michael B Allen | last post by:
I have a general purpose library that has a lot of checks for bad input parameters like: void * linkedlist_get(struct linkedlist *l, unsigned int idx) { if (l == NULL) { errno = EINVAL;...
99
by: Mikhail Teterin | last post by:
Hello! Consider the following simple accessor function: typedef struct { int i; char name; } MY_TYPE; const char *
2
by: Chris | last post by:
Hi, I have an SQL Query that loads a SQLDataReader object. The returned record has bit datatype columns that I use to provide true/false values. I can't get a definite answer googling on...
3
by: Martyn Fewtrell | last post by:
Hi there. I wonder if there was a "correct answer" for Vb.Net (I understand this is quite easy in C#). If im drawing data from a database using a TableAdapter the data ends up in a DataTable....
8
by: Fuzzydave | last post by:
Okay, I have been handed a python project and working through it I have had to add a report. I am returning 10 variables the results of an SQL Query and as usual the number of results vary from...
2
by: misty | last post by:
First i'll introduce myself since I only joined this forum this morning so hey! <waves> Right to the problem. I'm reading values from a html file using the getParameter method to produce an...
42
by: =?Utf-8?B?UGxheWE=?= | last post by:
I have an if statement that isn't working correctly and I was wondering how I check for a blank string. My Code Example if me.fieldname(arrayIndex) = "" then ----- end if When I do this and...
1
by: kannan1983 | last post by:
In a table i have to check each and every column for null values . if the column has null value i need to display as ' NULL VALUE' in the output , for these iam declaring some local variables Iam...
10
by: =?Utf-8?B?R3JlZw==?= | last post by:
I have the following three files. 1. Users.aspx is a webpage that uses the <asp:ObjectDataSourcecontrol to populate a simple <asp:ListBoxcontrol. 2. The UserDetails.cs file creates a Namespace...
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: 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)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.