I am refactoring a page that uses <body onload='myJS();'> to a user control. I understand I can do it using server side script registration on load.
If I want to do it on the client side (ascx), how would I do this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Taken from http://snipplr.com/view/3116/cross-browser-add-event-listener/
Use it like this:
addEvent(window, your_onload_handler). Or you could just use jquery for this and a lot of other things.