There are some methods to call javascript:
1.Response.Write(strJava);
2.Page.RegisterStartupScript("func1",strJava); //在PageLoad里面加载javascript
3.Page.RegisterClientScriptBlock("func1",strJava);
4.Add some attribute to webcontrols,for example:
btn.Attributes["onclick"]="Javascript:Method()";