Friday, 27 September 2013

asp.net client page validation not working for mobile chrome browser on iOS7, is there a workaround?

asp.net client page validation not working for mobile chrome browser on
iOS7, is there a workaround?

I have this javascript function that validates the page using asp.net 2.0
validation controls, with client-side validation enabled. I know there are
better ways of doing this but I don't have the luxury of time to rework
the validation architecture. To debug I open the site from Chrome, on my
desktop using the User Agent string from Chrome on iOS7 and the "Emulate
touch events" turned on. when I add the Page_Validators global array to
the watch list or hover over it while debugging the lines, it tells me it
is "not available". It seems like there is an issue with .Net's client
side scripts, yet I don't get an error from them at all. In safari it
works as expected and also on Android browsers.
function validatePage() {
var errorCount = 0;
if (typeof Page_Validators != 'undefined') {
Page_ClientValidate('1');
$.each(Page_Validators, function () {
//do some work...
});
if (errorCount > 0) {
//something happens here...
} else {
//something else happens here...
}
return errorCount;
}
}
Anybody know of a hot fix to make this work?

No comments:

Post a Comment