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

Relying on client-side validation?

Hi

I'm interested to know what peoples opinions are on using the Client-side
Validators in ASP.NET? I use them very heavily but am experiencing the odd
occassion when users have either intentionally or inadvertantly bipassed
them.

Any ideas on how this could happen. I know that a determined hacker can push
data into http context and viewstate. But other than that, would disabling
javascript in the browser allow a user to bipass validation yet still use
the site as normal?

Thanks

Ben
Nov 19 '05 #1
6 1275
Ben:
I rely on client-side validation heavily too, but only as a first step
measure. It's great because it's efficient for my server (no postback) and
responsive for the user (no postback).

But it's easily circumventable. By disabling javascript, by simply using
telnet, by using one of the many plugins for firefox.

You should always put a
Page.Validate()
if Page.IsValid then
...
end if

in your event handlers or wherever else you need to make sure the validation
is run on the server..

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"Ben Fidge" <be*******@btopenworld.com> wrote in message
news:ug****************@tk2msftngp13.phx.gbl...
Hi

I'm interested to know what peoples opinions are on using the Client-side
Validators in ASP.NET? I use them very heavily but am experiencing the odd
occassion when users have either intentionally or inadvertantly bipassed
them.

Any ideas on how this could happen. I know that a determined hacker can
push data into http context and viewstate. But other than that, would
disabling javascript in the browser allow a user to bipass validation yet
still use the site as normal?

Thanks

Ben

Nov 19 '05 #2
The built-in validation controls use both client side AND server side
validation by default.
This is to cover the scenarios you mentioned.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Ben Fidge" <be*******@btopenworld.com> wrote in message
news:ug****************@tk2msftngp13.phx.gbl...
Hi

I'm interested to know what peoples opinions are on using the Client-side
Validators in ASP.NET? I use them very heavily but am experiencing the odd
occassion when users have either intentionally or inadvertantly bipassed
them.

Any ideas on how this could happen. I know that a determined hacker can
push data into http context and viewstate. But other than that, would
disabling javascript in the browser allow a user to bipass validation yet
still use the site as normal?

Thanks

Ben

Nov 19 '05 #3
Karl,

Thanks for the advice. If for example I use your suggestion on the Confirm
button OnClick event on a given page, what's the standard procedure for
delaing with validation errors, or does ASP.NEt handle this automatically?

Ben

"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:OQ**************@TK2MSFTNGP09.phx.gbl...
Ben:
I rely on client-side validation heavily too, but only as a first step
measure. It's great because it's efficient for my server (no postback)
and responsive for the user (no postback).

But it's easily circumventable. By disabling javascript, by simply using
telnet, by using one of the many plugins for firefox.

You should always put a
Page.Validate()
if Page.IsValid then
...
end if

in your event handlers or wherever else you need to make sure the
validation is run on the server..

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"Ben Fidge" <be*******@btopenworld.com> wrote in message
news:ug****************@tk2msftngp13.phx.gbl...
Hi

I'm interested to know what peoples opinions are on using the Client-side
Validators in ASP.NET? I use them very heavily but am experiencing the
odd occassion when users have either intentionally or inadvertantly
bipassed them.

Any ideas on how this could happen. I know that a determined hacker can
push data into http context and viewstate. But other than that, would
disabling javascript in the browser allow a user to bipass validation yet
still use the site as normal?

Thanks

Ben


Nov 19 '05 #4
> You should always put a
Page.Validate()
if Page.IsValid then
...
end if
in your event handlers or wherever else you need to make sure the
validation is run on the server..


You shouldn't need to explicitly call Page.Validate unless you need to check
if the page has passed validation in or prior to Page_Load. If it's only
ever needed in your server side controls' event handlers, then Page.IsValid
is sufficient.

-Brock
DevelopMentor
http://staff.develop.com/ballen


Nov 19 '05 #5
Hi Brock,

Thanks for that. What is standard prcoedure for IsValid = false? Does
ASP.NET automatically report to the user that there's a problem using the
client-side validators or do I have to do this manually?

Ben
"Brock Allen" <ba****@NOSPAMdevelop.com> wrote in message
news:60**********************@msnews.microsoft.com ...
You should always put a
Page.Validate()
if Page.IsValid then
...
end if
in your event handlers or wherever else you need to make sure the
validation is run on the server..


You shouldn't need to explicitly call Page.Validate unless you need to
check if the page has passed validation in or prior to Page_Load. If it's
only ever needed in your server side controls' event handlers, then
Page.IsValid is sufficient.

-Brock
DevelopMentor
http://staff.develop.com/ballen

Nov 19 '05 #6
If the page fails to validate then the server side validation controls render
as such. At the end of the day it looks just like as if the validation was
done client-side. So, no, there's nothing special to do when you're relying
upon the server side validation. One thing to note is that if there is no
client side validation then things such as the ValidationSummary's ShowMessageBox
won't work as desired.

-Brock
DevelopMentor
http://staff.develop.com/ballen
Hi Brock,

Thanks for that. What is standard prcoedure for IsValid = false? Does
ASP.NET automatically report to the user that there's a problem using
the client-side validators or do I have to do this manually?

Ben

"Brock Allen" <ba****@NOSPAMdevelop.com> wrote in message
news:60**********************@msnews.microsoft.com ...
You should always put a
Page.Validate()
if Page.IsValid then
...
end if
in your event handlers or wherever else you need to make sure the
validation is run on the server..

You shouldn't need to explicitly call Page.Validate unless you need
to check if the page has passed validation in or prior to Page_Load.
If it's only ever needed in your server side controls' event
handlers, then Page.IsValid is sufficient.

-Brock
DevelopMentor
http://staff.develop.com/ballen


Nov 19 '05 #7

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

Similar topics

15
by: Michael Rybak | last post by:
hi, everyone. I'm writing a 2-players game that should support network mode. I'm now testing it on 1 PC since I don't have 2. I directly use sockets, and both client and server do...
2
by: Raquel | last post by:
How do I know whether the 'runtime client' and the 'application development client' are installed on my machine? When I issue the command "db2licm -l", it gives the following output: Product...
2
by: Rhino | last post by:
I am trying to verify that I correctly understand something I saw in the DB2 Information Center. I am running DB2 Personal Edition V8.2.1 on Windows. I came across the following in the Info...
0
by: Harley | last post by:
Hello, I am just learning the tcp/ip functions etc under vb.net so please look over me if this is obviouse. I have been all over looking into any functions that I didn't totaly understand and...
8
by: Ankit Aneja | last post by:
i am doing here some some socket-client work in C# windows service it is working fine for multiple clients now i want to limit these multiple clients to 25 for example i want that when service...
2
by: J Huntley Palmer | last post by:
I am having a horrific time integrating uw-imap's c-client for imap support in php. The problem is a whole bunch of "Text relocation remains referenced against symbol" errors during linking....
9
by: horizon5 | last post by:
Hi, my collegues and I recently held a coding style review. All of the code we produced is used in house on a commerical project. One of the minor issues I raised was the common idiom of...
0
by: khu84 | last post by:
Here is client server very simple code, seems to work with telnet but with with web client code gives blank output. Following is the server code:- <?php function...
2
by: nsaffary | last post by:
hi I hava a client/server program that run correctly when i run it in one computer(local) but when I run client on a one computer and run server run on another, connection does not stablish.(I set...
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: 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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.