Try the below with similar solution
http://stackoverflow.com/questions/14079029/how-to-call-javascript-function-on-page-load-in-asp-net[
^]
I created a sample and code flow reaches the javascript function on page load event.
protected void Page_Load(object sender, EventArgs e)
{
ClientScript.RegisterStartupScript(GetType(), "Javascript", "javascript:print(); ", true);
}
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script lang="javascript" type="text/javascript">
function print() {
// window.print();
alert('hello');
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
</form>
</body>
</html>