On form load

liunx

Guest
Hi,

I would like to apply a javascript function in when the form loads in ASP.NET so that the image changes when ever you load the page.

i am wondering what is the event i need to associate the javascript in form so that it applies it.

have any idea please let me know.

many thanksNot really an ASP.Net issue, but:

window.onload = onloadFunc
function onloadFunc() {
// do something here
}Hi, I think maybe we can make it become an ASP.net issue heheh:

under page_load, if this !isPostBack...

string js = "<script language='javascript'>";
js += "function onloadFunc() {//do something here}";
js += "</script>";

RegisterClientScriptBlock("javascript", js);


but like TheBearMay said, it would be alot easier if you just put those code under aspx instead of code behind.
 
Back
Top