which is better client/server validation

Posted by Jameschowdare under JavaScript on 12/3/2009 | Views : 1164 | Status : [Member] | Replies : 6
which is better client/server validation




Responses

Posted by: Vuyiswamb on: 12/4/2009 [Member] [MVP] [Administrator] NotApplicable

Up
0
Down
it depends what you asking for. When asking a Question please explain Clearly. In ASP.NET is good to do Validation on the Client side using java-script, its faster.

Thank you for posting at Dotnetfunda

Vuyiswa Maseko

Thank you for posting at Dotnetfunda
[Administrator]

Jameschowdare, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Muhilan on: 12/4/2009 [Member] Starter

Up
0
Down
Client Validation is faster because client side we can intimate the error , no Postback will happen.

ex.

The User name is Mandatory field. without entered the Username the user click before send to the server , we can do client slide validation for better performance.

Jameschowdare, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Virendradugar on: 12/4/2009 [Member] [MVP] Silver

Up
0
Down
Well, it depends on your requirement. You can go for Client Side validation, if your Javascript is not disabled as it will give you better performance.

But if Client side validation is disabled, then it better to go for Server side validation.

Best Practice is to do it on both the side.

Thanks,
Virendra Dugar

Jameschowdare, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Jameschowdare on: 12/7/2009 [Member] Starter

Up
0
Down
if client disable his browser then how to do validation

Jameschowdare, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vuyiswamb on: 12/7/2009 [Member] [MVP] [Administrator] NotApplicable

Up
0
Down
That is why i like Validating from the server side.

Thank you for posting at Dotnetfunda
[Administrator]

Jameschowdare, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Chikul on: 12/11/2009 [Member] Bronze

Up
0
Down
Hi Jameschowdare ,

We can use both. .In my knowledge Server side validation is more important.

Lets check 1 example.

There is one Text box, which should allow integer. (In DB its int)
Now use Javascript to validate it "onblur".
Then user can sees the error right away and can correct it before submits the request.

Lets we gave some Invalid value(char) and Click on submit.
So here if we'll not validate on Server side then it'll throw error.

So we should always validate any fields with requirements on the server to be in safe side.

Regards,
Chikul

Jameschowdare, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response