Frage

Today my Senior developer told me to use javascript instead of using RequiredFieldValidator in web form. He also told me that its server side validator,

but i read in many article that its a server-side and client-side both and i also know that how to use it in both situation,

Is there any Demerits of using RequiredFieldValidator in real world scenario? I am very curious to know about that.

Thanks

War es hilfreich?

Lösung

I would say in this case your senior developer is wrong.

You are correct in saying that the RequiredFieldValidator provides both server and client side validation. It's important to note that JavaScript validation can be bypassed so server side validation is very important.

On the other hand it's also important to provide visual feedback to the user, and the sooner this can be done (i.e. before a postback) the better. In this instance I would suggest that using the server side control is exactly the right choice.

You may find the following enter link description here useful which is the property to toggle client side validation on or off.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top