1.在后台添加需要调用的函数
protected string test()
{
return "test return";
}
2.在前台添加js代码
<head id="Head1" runat="server">
<script type="text/javascript">
function GetStr()
{
var result;
result = '';
result = '<%= this.test() %>'//test()为后台需要调用的函数
alert(result);
}
</script>
</head>
3.在控件上添加调用js的事件
<input id="button" type="button" value="click" onclick="GetStr()" />