You can call the javascript function from code behind file using ClientScript.RegisterStartupScript() method which accepts three parameters.
Example:
function Validate(msg)
{
alert(msg);
}
Calling The function from code behind file.
protected void Button1_Click(object sender,EventArgs e)
{
ClientScript.RegisterStartupScript(this.GetType(),"AnyName","javascript: validate('Hello')",true);
}
You can refer the following link about the method ClientScript.RegisterStartupScript().
http://msdn.microsoft.com/en-us/library/z9h4dk8y.aspx[
^]