RequiredFieldValidator - So if Javascript is disabled the whole .NET controls are avoided?

后端 未结 1 1371
情深已故
情深已故 2021-01-15 03:13

I\'m using .NET recently, and I check some fields.

I know that the check is client-side (javascript) and on server-side with :

Page.Validate();

if (         


        
相关标签:
1条回答
  • 2021-01-15 03:50

    You are right, using Page.IsValid will only return correct value if javascript is enabled / supported in the browser. So, good web programming practice is to run same validations again at server side regardless of client side validation consideration. Because client side javascript can be altered easily in browser to bypass that the validations.

    That will ensure you are accepting correct values.

    0 讨论(0)
提交回复
热议问题