W
weboweb
Hello group,
I've been scouring documentation for when a user disables Javascript
and posts a webform with invalid data.
Here's my confusion:
The microsoft docs assure you that the server validator controls
ALWAYS perform validation server-side.
However, in many other places I've read that you ALWAYS must check
Page.IsValid property, usually at the click / command events that
cause the postbacks, before you run, let's say, some DB code to update
your database with potentially invalid data.
All nice and dandy, but from my tests when I disable Javascript at the
client simply by setting EnableClientScript property to false, the
page is posted back with invalid data, and the server DOES NOT let it
through (the validator controls fire up and show their error messages
when the page reloads)
Isn't that at odds with "you must ALWAYS check Page.IsValid to prevent
invalid data from making it through to your database?" as I've read in
many places (newsgroups, articles, etc)
Please anybody shed some light on this, I haven't been able to find a
definitive answer.
Again, from my tests, the validator controls do stop this from
happening.
Thanks a lot
webO
I've been scouring documentation for when a user disables Javascript
and posts a webform with invalid data.
Here's my confusion:
The microsoft docs assure you that the server validator controls
ALWAYS perform validation server-side.
However, in many other places I've read that you ALWAYS must check
Page.IsValid property, usually at the click / command events that
cause the postbacks, before you run, let's say, some DB code to update
your database with potentially invalid data.
All nice and dandy, but from my tests when I disable Javascript at the
client simply by setting EnableClientScript property to false, the
page is posted back with invalid data, and the server DOES NOT let it
through (the validator controls fire up and show their error messages
when the page reloads)
Isn't that at odds with "you must ALWAYS check Page.IsValid to prevent
invalid data from making it through to your database?" as I've read in
many places (newsgroups, articles, etc)
Please anybody shed some light on this, I haven't been able to find a
definitive answer.
Again, from my tests, the validator controls do stop this from
happening.
Thanks a lot
webO