1.c#如何向javascript传递数据?
在后台定义3个变量,要有 public 修饰符,如
public string a = "aaa";
public string b = "bbb";
public string c = "ccc";
在前台js调用
function test() {
var a = "<%=a %>";
var b = "<%=b %>";
var c = "<%=c %>";
alert("a:"+a +",b:"+ b+",c:" + c);
}
test();