C#后台代码,用JS怎么和前台交互。

2025-02-25 12:34:55
推荐回答(5个)
回答1:

Page.ClientScript.RegisterStartupScript(this.GetType(), “”, "这里面填写你的js方法", true);
如:
ClientScript.RegisterStartupScript(this.GetType(), “”, "alert('这是后台调用js')", true);

其中参数中的true表示自己在你的方法两端加"