Utilizing the ASP.NET Validator to validate numerous inputs in my WebForm has proven effective on the client side. I appreciate being able to validate inputs without triggering a page reload.
However, when attempting to use the Validator on the code behind, the Page.Isvalid
attribute raises questions about its reliability. The following inquiries have left me perplexed:
- Can the Validator be trusted for client-side validation? (Apart from disabling javascript, is it susceptible to manipulation?)
- How does the Validator access validity information on the server side? (Does it rely on generated C# Validator code or directly retrieve data from the client-side?)
I've included the code snippet below that I implemented to validate inputs on the server side as well:
foreach (IValidator iValidator in Page.Validators)
{
if (!iValidator.IsValid) { return false; }
}
Yet, can this method function independently of .aspx and .js files? Is it a dependable approach for server-side validation?