我在外部JS文件中有一个JavaScript函数。我想从后面的co0de中调用它。我怎样才能做到这一点 ? 我从ScriptManager.RegisterStartupScript
的地方读到了一些我可以做的地方,但是如何,任何人都可以解释我。从C代码中调用Javascript函数#
JS文件:
Function1()
{
alert("came");
//Some More logic
}
更新
从
//Tried this But NOT WORKING
protected void Page_PreRender(object sender, EventArgs e)
{
ScriptManager.RegisterStartupScript(this, GetType(), "Function1", "Function1();", true);
Page.ClientScript.RegisterStartupScript(GetType(), "Function1", "Function1()", true);
}
可能重复【如何调用从C#jQuery函数(http://stackoverflow.com/questions/22216177/how-to-call-j-jQuery-function-from-c-sharp) – IamStalker