扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
//客户端回调时固定调用此方法 public void RaiseCallbackEvent(String eventArgument) //执行完RaiseCallbackEvent后将调用此方法。此方法的返回值将被发回客户端 public string GetCallbackResult() |
.cs: String cbReference = Page.ClientScript.GetCallbackEventReference(this,"arg", "ReceiveServerData", "context"); String callbackScript; callbackScript = "function CallServer(arg, context)" + "{ " + cbReference + "} ;"; Page.ClientScript.RegisterClientScriptBlock(this.GetType(),"CallServer", callbackScript, true); javascript: <script type="text/javascript"> function LookUpStock() { var product = ""; var lb = document.forms[0].ListBox1; if(lb.selectedIndex >= 0) product = lb.options[lb.selectedIndex].text; CallServer(product, ""); } function ReceiveServerData(rValue) { Results.innerText = rValue; } </script> |
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。