Issue
If you create Master/Content page setup in Visual Studio 2005, you quickly realize that Content pages do not include essential HTML tags such as Head and body. Therefore, Onload event of JavaScript cannot be used on the body tag.
Workaround
Use the following in you Content page:
<script type="text/javascript" >
window.onload=MyFunction;
< /script>
MyFunction is a placeholder for your function name.
Note: there are no parentheses preceding the function name. If parentheses are used in front of the function name, user will recieve JavaScript runtime error "Not implemented".
No comments:
Post a Comment