question about Page_ClientValidate() function

  • Thread starter Thread starter Bob
  • Start date Start date
B

Bob

Hi,

i know what the javascript function Page_ClientValidate() function does:
tests if all controls meet asp.net validation criteria. This function is
provided by asp.net.
But how can a browser (and escpecially firefox, netscape ..) understand that
function, because it's not pre-programmed in the browser like the base
javascript code.

Thanks
Bob
 
All what the function does is defined in ASP.NET's client-side validsation
library which is loaded to the browser by ASP.NET when a page needing
validation controls is requested.

Starting in ASP.NEt 2.0 these functions (there are quite a alot of them)
have been written in cross-browser compatible way so they work in all modern
browsers.

For example Page_ClientValidate

function Page_ClientValidate(validationGroup) {
Page_InvalidControlToBeFocused = null;
if (typeof(Page_Validators) == "undefined") {
return true;
}
var i;
for (i = 0; i < Page_Validators.length; i++) {
ValidatorValidate(Page_Validators, validationGroup, null);
}
ValidatorUpdateIsValid();
ValidationSummaryOnSubmit(validationGroup);
Page_BlockSubmit = !Page_IsValid;
return Page_IsValid;
}
 
E.g down to the bottom these functions are just javascript accessing DOM
etc. E.g that base javascript.


--
Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net


Teemu Keiski said:
All what the function does is defined in ASP.NET's client-side validsation
library which is loaded to the browser by ASP.NET when a page needing
validation controls is requested.

Starting in ASP.NEt 2.0 these functions (there are quite a alot of them)
have been written in cross-browser compatible way so they work in all
modern browsers.

For example Page_ClientValidate

function Page_ClientValidate(validationGroup) {
Page_InvalidControlToBeFocused = null;
if (typeof(Page_Validators) == "undefined") {
return true;
}
var i;
for (i = 0; i < Page_Validators.length; i++) {
ValidatorValidate(Page_Validators, validationGroup, null);
}
ValidatorUpdateIsValid();
ValidationSummaryOnSubmit(validationGroup);
Page_BlockSubmit = !Page_IsValid;
return Page_IsValid;
}


--
Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net


Bob said:
Hi,

i know what the javascript function Page_ClientValidate() function does:
tests if all controls meet asp.net validation criteria. This function is
provided by asp.net.
But how can a browser (and escpecially firefox, netscape ..) understand
that function, because it's not pre-programmed in the browser like the
base javascript code.

Thanks
Bob
 
Thanks, but i still don't know how a browser can interpret those new
functions. The browser (IE, Netscape ..) on my desktop doens't know those
new functions, right? So they must be passed from aspnet (server) to the
browser by a way or another in order to be integrated into the browser.
You see what i don't understand?
Thanks

Teemu Keiski said:
E.g down to the bottom these functions are just javascript accessing DOM
etc. E.g that base javascript.


--
Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net


Teemu Keiski said:
All what the function does is defined in ASP.NET's client-side
validsation library which is loaded to the browser by ASP.NET when a page
needing validation controls is requested.

Starting in ASP.NEt 2.0 these functions (there are quite a alot of them)
have been written in cross-browser compatible way so they work in all
modern browsers.

For example Page_ClientValidate

function Page_ClientValidate(validationGroup) {
Page_InvalidControlToBeFocused = null;
if (typeof(Page_Validators) == "undefined") {
return true;
}
var i;
for (i = 0; i < Page_Validators.length; i++) {
ValidatorValidate(Page_Validators, validationGroup, null);
}
ValidatorUpdateIsValid();
ValidationSummaryOnSubmit(validationGroup);
Page_BlockSubmit = !Page_IsValid;
return Page_IsValid;
}


--
Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net


Bob said:
Hi,

i know what the javascript function Page_ClientValidate() function does:
tests if all controls meet asp.net validation criteria. This function is
provided by asp.net.
But how can a browser (and escpecially firefox, netscape ..) understand
that function, because it's not pre-programmed in the browser like the
base javascript code.

Thanks
Bob

 
Howdy,

They are downloaded by browser through WebResource.axd http handler. View
HTML source of the page and you'll see something like <script
type="text/javascript" src="WebResource.axd?54£%£$%5whatever". in order to
see content of these files simply select File->Save As to a new directory (
you'll find all the files there, including javascripts as well).

Regards
--
Milosz


Bob said:
Thanks, but i still don't know how a browser can interpret those new
functions. The browser (IE, Netscape ..) on my desktop doens't know those
new functions, right? So they must be passed from aspnet (server) to the
browser by a way or another in order to be integrated into the browser.
You see what i don't understand?
Thanks

Teemu Keiski said:
E.g down to the bottom these functions are just javascript accessing DOM
etc. E.g that base javascript.


--
Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net


Teemu Keiski said:
All what the function does is defined in ASP.NET's client-side
validsation library which is loaded to the browser by ASP.NET when a page
needing validation controls is requested.

Starting in ASP.NEt 2.0 these functions (there are quite a alot of them)
have been written in cross-browser compatible way so they work in all
modern browsers.

For example Page_ClientValidate

function Page_ClientValidate(validationGroup) {
Page_InvalidControlToBeFocused = null;
if (typeof(Page_Validators) == "undefined") {
return true;
}
var i;
for (i = 0; i < Page_Validators.length; i++) {
ValidatorValidate(Page_Validators, validationGroup, null);
}
ValidatorUpdateIsValid();
ValidationSummaryOnSubmit(validationGroup);
Page_BlockSubmit = !Page_IsValid;
return Page_IsValid;
}


--
Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net


Hi,

i know what the javascript function Page_ClientValidate() function does:
tests if all controls meet asp.net validation criteria. This function is
provided by asp.net.
But how can a browser (and escpecially firefox, netscape ..) understand
that function, because it's not pre-programmed in the browser like the
base javascript code.

Thanks
Bob


 
Milosz gave you the answer that they are resources in System.Web assembly,
loaded with WebResource handler. You can also inspect all those resources by
getting Reflector, and viewing resources in System.Web assembly (especially
WebUIValidation.js)

http://www.aisto.com/roeder/dotnet/


--
Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net

Bob said:
Thanks, but i still don't know how a browser can interpret those new
functions. The browser (IE, Netscape ..) on my desktop doens't know those
new functions, right? So they must be passed from aspnet (server) to the
browser by a way or another in order to be integrated into the browser.
You see what i don't understand?
Thanks

Teemu Keiski said:
E.g down to the bottom these functions are just javascript accessing DOM
etc. E.g that base javascript.


--
Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net


Teemu Keiski said:
All what the function does is defined in ASP.NET's client-side
validsation library which is loaded to the browser by ASP.NET when a
page needing validation controls is requested.

Starting in ASP.NEt 2.0 these functions (there are quite a alot of them)
have been written in cross-browser compatible way so they work in all
modern browsers.

For example Page_ClientValidate

function Page_ClientValidate(validationGroup) {
Page_InvalidControlToBeFocused = null;
if (typeof(Page_Validators) == "undefined") {
return true;
}
var i;
for (i = 0; i < Page_Validators.length; i++) {
ValidatorValidate(Page_Validators, validationGroup, null);
}
ValidatorUpdateIsValid();
ValidationSummaryOnSubmit(validationGroup);
Page_BlockSubmit = !Page_IsValid;
return Page_IsValid;
}


--
Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net


Hi,

i know what the javascript function Page_ClientValidate() function
does: tests if all controls meet asp.net validation criteria. This
function is provided by asp.net.
But how can a browser (and escpecially firefox, netscape ..) understand
that function, because it's not pre-programmed in the browser like the
base javascript code.

Thanks
Bob


 
Thanks to both

Teemu Keiski said:
Milosz gave you the answer that they are resources in System.Web assembly,
loaded with WebResource handler. You can also inspect all those resources
by getting Reflector, and viewing resources in System.Web assembly
(especially WebUIValidation.js)

http://www.aisto.com/roeder/dotnet/


--
Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net

Bob said:
Thanks, but i still don't know how a browser can interpret those new
functions. The browser (IE, Netscape ..) on my desktop doens't know those
new functions, right? So they must be passed from aspnet (server) to the
browser by a way or another in order to be integrated into the browser.
You see what i don't understand?
Thanks

Teemu Keiski said:
E.g down to the bottom these functions are just javascript accessing DOM
etc. E.g that base javascript.


--
Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net


All what the function does is defined in ASP.NET's client-side
validsation library which is loaded to the browser by ASP.NET when a
page needing validation controls is requested.

Starting in ASP.NEt 2.0 these functions (there are quite a alot of
them) have been written in cross-browser compatible way so they work in
all modern browsers.

For example Page_ClientValidate

function Page_ClientValidate(validationGroup) {
Page_InvalidControlToBeFocused = null;
if (typeof(Page_Validators) == "undefined") {
return true;
}
var i;
for (i = 0; i < Page_Validators.length; i++) {
ValidatorValidate(Page_Validators, validationGroup, null);
}
ValidatorUpdateIsValid();
ValidationSummaryOnSubmit(validationGroup);
Page_BlockSubmit = !Page_IsValid;
return Page_IsValid;
}


--
Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net


Hi,

i know what the javascript function Page_ClientValidate() function
does: tests if all controls meet asp.net validation criteria. This
function is provided by asp.net.
But how can a browser (and escpecially firefox, netscape ..)
understand that function, because it's not pre-programmed in the
browser like the base javascript code.

Thanks
Bob


 
Back
Top