我对从 javascript 调用 .cs 类文件(C#)函数有疑问 我的代码:我有像 call_cs_function_from_js 这样的类文件(.cs)
------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace call_cs_function_from_js
{
public class cal_lcs_function_from_js
{
public void getdata()
{
}
}
}
这是javascript代码文件:
<script type="text/javascript">
function call(){
cal_lcs_function_from_js.getdata(); //This way is not working
alert('called');
}
</script>
在这里,我想从 call()(意思是 .js)调用 cal_lcs_function_from_js 的 getdata。call() 在按钮单击时调用。
请告诉我其他方法是什么。