You can't call js from code-behind because js only exists in the browser and your code-behind is generating the response to send to the browser so the js only exists when your server code has finished. What you *can* do is add js to the output that calls the js you want to execute when the browser loads. You can use
Page.RegisterStartupScript Method (String, String) (System.Web.UI)[
^] to do that.
Alternatively you could google "asp.net call javascript from code behind" where you will see this is a very frequently asked question and you'll doubtless find more examples.