notice: js加载写在body或者之后,在head中会报错
前台js:(传变量值)
<script type="text/javascript" charset="utf-8">
var loginStation = <%= canUseSta%>;
var StaitonDatas = <%= datas%>;
</script>
----------------------------------
后台cs:
//根据具体情况为变量赋值
public string datas;
public string canUseSta;
----------------------------------
后台往前台传方法:
var something = <%=getSometing()%>;
C#代码:
public static string getSometing() { return "返回值"; }