Despite of many "answers" with examples published on this site, you never really call Javascript from ASP.NET code. It will became quite obvious if you understand what happens on server side and on client side. You ASP.NET code behind works on the server side. All it does is processing the HTTP request and producing some content in HTTP response. As you ask about Javascript, this content is HTML, Javascript, and anything which can come with HTML.
What ASP.NET code does to Javascript? If generates it, perhaps having some fragments of code (usually some
immediate constants, which are, from the standpoint of the ASP.NET application are variable) calculating and generating on the fly. And when the HTML page with Javascript arrives to the client side, a Web browser calls the Javascript functions, in response to events invokes in the browser, according certain rules you should know. From this moment, this code is totally
agnostic to ASP.NET, as well as any other server-side technology. So, learn how Javascript works separately, without any connection to ASP.NET.
See also:
http://msdn.microsoft.com/en-us/library/System.Web.UI.ClientScriptManager%28v=vs.110%29.aspx[
^].
—SA