If you want to register a script that will be used in connection with an UpdatePanel (AJAX) use ScriptManager class as Sani Huttunen pointed. Otherwise you should use the class ClientScriptManager (methods Page.ClientScript.RegisterClientScriptBlock or Page.ClientScript.RegisterStartupScript). As other user pointed, normally registering a script on the code behind can and should be avoided.
You can not call a server side function in client side scripts, Two solution is available for you 1. Reload whole of page by window. location.reload() or post back the page by a ASP.NET control. 2. Use Ajax technology My recommend is using the built-in Ajax in ASP.NET.
VBScript Function Procedures. A Function procedure: is a series of statements, enclosed by the Function and End Function statements; can perform actions and can return a value; can take arguments that are passed to it by a calling procedure; without arguments, must include an empty set of parentheses returns a value by assigning a value to its name.
An ASP.NET page is made up of a number of server controls along with HTML controls, text, and images. Sensitive data from the page and the states of different controls on the page are stored in hidden fields that form the context of that page request. ASP.NET runtime controls the association between.