<script type=
function ReceiveServerData(rValue)
{
alert(rValue);
}
</script>
<input id=
服務端代碼:
public partial class back
{
public string CallBackValue = null;
protected void Page_Load(object sender
{
}
// 注冊腳本到前台頁面
protected void Page_PreRender(object sender
{
RegClientScript();
}
// javascript函數(服務器端事件的客戶端回調)
protected void RegClientScript()
{
ClientScriptManager cs = Page
string jstxt=@
function CallServer(msgid)
{
}
cs
}
//ICallbackEventHandler接口
//把值傳到前台
string ICallbackEventHandler
{
return CallBackValue +
}
//按受前台的參數
void ICallbackEventHandler
{
this
}
}
From:http://tw.wingwit.com/Article/program/net/201311/13328.html