方法一:前台调用后台方法传参数
1: <script> 2: function Show() 3: { 4: var Keys=0;5: var a="<%=ButtShow(""+strid+"") %>"; //调用后台变量
6: 7: } 8: </script> 9: 10: public string strid = "000";
11: public string ButtShow(string strs)
12: { 13: 14: 15: return strs;
16: 17: } 18: 方法二:不传参数
1: <script> 2: function Show() 3: { 4: var Keys=0;5: var a="<%=ButtShow() %>"; //调用后台变量
6: 7: } 8: </script> 9: 10: public string strid = "000";
11: public string ButtShow(string strs)
12: { 13: 14: 15: return "123";
16: 17: } 18: 方法三:直接传参数
1: <script> 2: function Show() 3: { 4: var Keys=0;5: var a="<%=ButtShow("0") %>";
6: 7: } 8: </script> 9: 10: public string strid = "000";
11: public string ButtShow(string strs)
12: { 13: 14: 15: return "123";
16: 17: } 18:
浙公网安备 33010602011771号