长沙震烨科技有限公司 专注研发高校招生考试系统

C# 调用前台js和js调用后台C#

2017/5/5 15:30:01 人评论 次浏览 分类:C#学习中心

C# 调用js 方法:


 this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "", "<script>jqcqall();</script>");


js调用C#方法:

1:使用<%=C#方法=%>

2:在异步时使用 PageMethods,如果出现PageMethods未定义:<asp:ScriptManager ID="ScriptManager1" runat="server"  EnablePageMethods="true">

附件下载