I have an asp.net website and I have created a default page (Default.aspx) with MasterPage. Like this i have created many pages (.aspx) with the same MasterPage.
Now i want to write a javascript body onload event only to Default.aspx. How can i do this? because body tag is in master page. but i want to use it only to Default.aspx.
in the cs file put following line
ClientScript.RegisterStartupScript(ClientScript.GetType(), “onLoad”, “fnTest()”, true);
In aspx file put following line
<script type=”text/javascript”>
function fnTest()
{
alert(‘Hi’);
}
</script>














Wow! This helped me soooo much!
Thanks IR0N0RR, your the man and the legend!