473,322 Members | 1,523 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.

Client-Side Validation using ASP.NET

Hello Guys,

I am using the validation controls to validate my data.
But the problem is "The page is still being posted to
server".

I want to get rid of the round trips to server. Are there
any get arounds for this problem apart from the
traditional JavaScript?

I mean to say ... can we use validation controls at the
client-side ONLY and not at the server-side? I understand
that there is a ClientValidate which is costly as I have
to maintain similar code at the server too.

Thanks a bunch!

Nov 18 '05 #1
4 2327
Anonymous,

The point of client side validation is to save a trip to the server. But
client side validation isn't guaranteed to work becuase of the wide
assortment of computers and browsers.

The way .Net handles this is to use client side validation to rule out
unecessary trips to the server for clients and browsers that it will work
for.

The validation on the server side can then be skipped by using an if/then
such as:

If Page.IsValid Then
'---your code here
End If

..Net checks if the client side validation worked and if so skips the server
side validation.

If the client side validation didn't work then the server side validation
takes over.

Also, all .net validators check if input is valid both client side and
server side (if the client validation didn't work). This means that a round
trip to the server won't take place if the client side validators are able
to run.

I hope this helps.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
<an*******@discussions.microsoft.com> wrote in message
news:04****************************@phx.gbl...
Hello Guys,

I am using the validation controls to validate my data.
But the problem is "The page is still being posted to
server".

I want to get rid of the round trips to server. Are there
any get arounds for this problem apart from the
traditional JavaScript?

I mean to say ... can we use validation controls at the
client-side ONLY and not at the server-side? I understand
that there is a ClientValidate which is costly as I have
to maintain similar code at the server too.

Thanks a bunch!

Nov 18 '05 #2
Jos
an*******@discussions.microsoft.com wrote:
Hello Guys,

I am using the validation controls to validate my data.
But the problem is "The page is still being posted to
server".
Do you mean that the client-side validation doesn't work?
Is this with all users?
What kind of validation controls did you use?
I want to get rid of the round trips to server. Are there
any get arounds for this problem apart from the
traditional JavaScript?

I mean to say ... can we use validation controls at the
client-side ONLY and not at the server-side? I understand
that there is a ClientValidate which is costly as I have
to maintain similar code at the server too.


Using client-side validation only is unsafe, because
malicious users have many ways to by-pass it.
Therefore, if safety is important, never trust the client-side
validation!

--

Jos
Nov 18 '05 #3
Dear Justin,

Thanks for your reply!

Let me explain you my concern in detail....

I have a login field which I am validating using
RequiredValidator control. Now when a user omits this
field, the ErrorMessage is displayed successfully with the
help of validator control, but the page is still being
posted back to the server.

As you said, if the validation is done successfully at the
client-side, server-side validation is skipped. But I want
to stop the postback completely if the user omits the
login field. Can this be done using ASP.NET?

Thanks in advance!
-----Original Message-----
Anonymous,

The point of client side validation is to save a trip to the server. Butclient side validation isn't guaranteed to work becuase of the wideassortment of computers and browsers.

The way .Net handles this is to use client side validation to rule outunecessary trips to the server for clients and browsers that it will workfor.

The validation on the server side can then be skipped by using an if/thensuch as:

If Page.IsValid Then
'---your code here
End If

..Net checks if the client side validation worked and if so skips the serverside validation.

If the client side validation didn't work then the server side validationtakes over.

Also, all .net validators check if input is valid both client side andserver side (if the client validation didn't work). This means that a roundtrip to the server won't take place if the client side validators are ableto run.

I hope this helps.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
<an*******@discussions.microsoft.com> wrote in message
news:04****************************@phx.gbl...
Hello Guys,

I am using the validation controls to validate my data.
But the problem is "The page is still being posted to
server".

I want to get rid of the round trips to server. Are there any get arounds for this problem apart from the
traditional JavaScript?

I mean to say ... can we use validation controls at the
client-side ONLY and not at the server-side? I understand that there is a ClientValidate which is costly as I have
to maintain similar code at the server too.

Thanks a bunch!

.

Nov 18 '05 #4
Anonymous,

The behaviour you would like is what .Net already does.

What browser are you testing with? If a required field is omitted then the
page typically does not post back to the server, but that behaviour doesn't
work with all browsers.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
<an*******@discussions.microsoft.com> wrote in message
news:96****************************@phx.gbl...
Dear Justin,

Thanks for your reply!

Let me explain you my concern in detail....

I have a login field which I am validating using
RequiredValidator control. Now when a user omits this
field, the ErrorMessage is displayed successfully with the
help of validator control, but the page is still being
posted back to the server.

As you said, if the validation is done successfully at the
client-side, server-side validation is skipped. But I want
to stop the postback completely if the user omits the
login field. Can this be done using ASP.NET?

Thanks in advance!
-----Original Message-----
Anonymous,

The point of client side validation is to save a trip to

the server. But
client side validation isn't guaranteed to work becuase

of the wide
assortment of computers and browsers.

The way .Net handles this is to use client side

validation to rule out
unecessary trips to the server for clients and browsers

that it will work
for.

The validation on the server side can then be skipped by

using an if/then
such as:

If Page.IsValid Then
'---your code here
End If

..Net checks if the client side validation worked and if

so skips the server
side validation.

If the client side validation didn't work then the server

side validation
takes over.

Also, all .net validators check if input is valid both

client side and
server side (if the client validation didn't work). This

means that a round
trip to the server won't take place if the client side

validators are able
to run.

I hope this helps.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
<an*******@discussions.microsoft.com> wrote in message
news:04****************************@phx.gbl...
Hello Guys,

I am using the validation controls to validate my data.
But the problem is "The page is still being posted to
server".

I want to get rid of the round trips to server. Are there any get arounds for this problem apart from the
traditional JavaScript?

I mean to say ... can we use validation controls at the
client-side ONLY and not at the server-side? I understand that there is a ClientValidate which is costly as I have
to maintain similar code at the server too.

Thanks a bunch!

.

Nov 18 '05 #5

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: Delmar | last post by:
I need to build Web Application that will generate a client to execute some operations. Each client has running silent application. Maybe somebody can advice me what can I do ? Thank you.
14
by: Ankit Aneja | last post by:
The code of classes given below is for server to which clients connect i want to get ip address of client which has connected pls help how can i get //listen class public class listen {
2
by: Frank Swarbrick | last post by:
I am trying to understand "client authentication" works. My environment is DB2/UDB LUW 8.2 on zSeries SLES9 as the database server and DB2 for VSE 7.4 as the client. We currently have DB2/LUW set...
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: 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...
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: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
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
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.