Why do we need both client side and server side validation

preview_player
Показать описание
Link for all dot net and sql server video tutorial playlists

Link for slides, code samples and text version of the video

Healthy diet is very important both for the body and mind. If you like Aarvi Kitchen recipes, please support by sharing, subscribing and liking our YouTube channel. Hope you can help.

In this video we will discuss, why we need both client side and server side validation. This is a common interview question as well. This is continuation to Part 1. Please watch Part 1 before proceeding.

Client side validation can be very easily bypassed by disabling Javascript on a client browser. For example the following are the steps to disable Javascript in Google chrome.
1. Open Google Chrome browser
2. Click on the Customise button on the top right hand corner of the browser
3. Select Settings from the context menu
4. Type Javascript, in the Search Settings textbox
5. Click on "Content Settings" button
6. Under "JavaScript" section select "Do not allow any site to run JavaScript" radio button.
7. Close "Content Settings" window

In the application that we worked with in Part 1, comment the call to ValidatForm() method. This is the server side medthod that validates form input. At this point the code in btnSubmit_Click() method should be as shown below.
protected void btnSubmit_Click(object sender, EventArgs e)
{
//if (ValidatForm())
//{
SaveData();
//}
}

So, at the moment
1. We have disabled Javascript on the client browser
2. We don't have any server side validation

Run the application and click the Submit button, without filling any data. Notice that an empty row is inserted into Users table.

This is because client side validation is bypassed as we have disabled JavaScript and we also don't have any server side method validating the form. This is one of the reasons why we always want to have both client side and server side validation.

If JavaScript is disabled and if we don't have any server side validation, there could be different threats ranging from storing invalid data to security vulnerabilities.

Client-side validation provides better user experience as it reduces the unnecessary round trips between the client and the server. So client side validation is nice to have.

However, if JavaScript is disabled or if the user is making a request using tools like fiddler we still want to validate the form before saving data. So, server side validation should always be there irrespective of whether we have client side validation or not.
Рекомендации по теме
Комментарии
Автор

You are giving life to lots of people...thankful forever

nammozhi
Автор

Oh Venkat
You are not just a teacher. You are a doctor and efficiently

mahmoudraslan
Автор

IMy eyes 👀 are wet & in tears, Ur teachings if I wud had followed years back... No one in this Globe can Teach, such honestly & complete 💯 depth... As u mentioned earlier in ur initial Vides, U R MAKING THESE VIDEO'S SPECIALLY FOR THOSE ECONOMICALLY WEAK PEOPLE, WHO CANT AFFORD EXPENSIVE SOFTWARE
This is Complete 💯 GOODNESS from a Gem 💖 Heart person ..
MY DREAM, if I cud meet u ever in life to get u once & have ur Autograph. Dearest VENKAT SIR 🙏🙏🙏🙏

shovikchaurasia
Автор

this man is so good at teaching! a million times better than uni professor!

justinli
Автор

Glad to see a new series coming up. Your videos are the reason I got a full-time job as a developer. Thanks for the help!

twitterpaited
Автор

You're amazing man keep up please finish this series as soon as possible can't wait to learn javascript with you tutorials i learned everything with your help !!

awacheaterscs
Автор

Great Video and all the previous playlists... Thanks a lot (reason i am writing it here so that you can see it as its a recent Keep up the great work stay motivated...

Shaipasi
Автор

This is perfect! It's exactly what I was looking for. Thank you!

deepeddyrecords
Автор

Hi sir thanks for sharing these videos. All these videos are helpful to us to learn different topics that we require. From these training class videos I learned a lot...

prasadkklv
Автор

Your voice is very relaxing, which is nice to listen to but not so good for someone doing late night homework hah

TheLugiaSong
Автор

Nice to follow your new JavaScript series. Thank You.

mouradbarakat
Автор

Suppper explanation,
Thank you....!!!

gud_man-cs
Автор

Thank you for sharing and have a great day.

DhrubaAdhikari
Автор

Good Morning Sir, Which Book for Javascript I have to use.

saurabhkatrojwar
Автор

Thank you for these videos. I have a question, if I have server and client side validation, why aren't both functions being executed when I hit the submit button?

peekaytime
Автор

pls add wpf tutorials. i am having hard time learning it as no good tutorial is present on youtube for same.

nishthakapur
Автор

Sir I didn't understand use of fidder tool use so can u describe it briefly

hiteshsahu
Автор

What is difference between their Delay?

muhammadusmanahmed
Автор

im begginner in javascript, can i go through this tutorials??

anishmaharzan
Автор

i need all of tutorials of this series. can i.? (some videos of this series has been deleted, what can i do now.?)

me.noman
join shbcf.ru