473,225 Members | 1,349 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,225 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 2319
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...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...

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.