question about Page_ClientValidate() function

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
 
T

Teemu Keiski

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;
}
 
T

Teemu Keiski

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
 
B

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

 
G

Guest

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


 
T

Teemu Keiski

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


 
B

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


 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,023
Latest member
websitedesig25

Latest Threads

Top