1、js调用前台嵌入的c#方法:<%@ Import Namespace="System" %><%@ Import Namespace="System.IO" %><%@ Import Namespace="System.Runtime.InteropServices" %><script language="c#" runat="server">。
2、输入:public string TestJSToFunction() { return "JS调用页面c#方法"; } public string TestJSToFunction(string strTest, string ss) { return strTest。
3、其中有不含参数的方法,含一个,含两个参数的方法。// 2014-2-20添加测试。
4、获取SL中页面代码中变量值 functio艘绒庳焰n getUserNamePwd(userName, Pwd) { //alert(userName + "\n" + Pwd); var name = userName + ',' + Pwd; var pwd = Pwd。
5、述语句中 var stt='<%=TestJSToFunction("' + name+','+pwd + '") %>';调用含有一个参数的c#方法。