我正在尝试使用 javascript 为网页中的控件调用 WebMethod (GetData())。
<script type="text/javascript">
$(document).ready(function () {
//this selector needs fixed
$('<%= Control1.ClientID %>').GetData();
});
</script>
<tel:RadScriptManager ID="RadScriptManager1" runat="server" />
<tel:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="RadAjaxLoadingPanel1">
<uc1:Control ID="Control1" runat="server" />
</tel:RadAjaxPanel>
uc:控制代码:
[WebMethod()]
[ScriptMethod()]
protected void GetData()
{
//stuff happens here
}
我不知道要使用哪种选择器。我在页面上有多个控件,我想在不同的时间调用它们。我使用什么样的选择器或什么命令来运行这个 WebMethod?