我有一個頁面,我有一個ModalPopUpExtender,我想從代碼中顯示。ASP.NET Ajax查找組件問題
這是我的地盤結構,它是一個嵌套的母版中的Web表單:
...
<asp:Content ID="con" ContentPlaceHolderID="mainContent" runat="server">
<asp:MultiView ID="tabMultiView" runat="server">
<asp:View ID="generalTab" runat="server">
<asp:ScriptManager ID="scriptManager" runat="server">
</asp:ScriptManager>
<ajaxToolkit:ModalPopupExtender ID="newAddressModalPopup" CancelControlID="newAddressDialogCancelButton"
BackgroundCssClass="modalBackground" TargetControlID="newAddressLink" PopupControlID="newAddressDialogDiv"
runat="server">
</ajaxToolkit:ModalPopupExtender>
...
<a href="" onclick="openNewAddressDialog()">open dialog</a>
<script type="text/javascript">
function openNewAddressDialog() {
$find('<%= newAddressModalPopup.ClientID %>').show();
}
</script>
...
find方法總是返回null。我也嘗試過findComponent等,它始終爲空。當我調試該方法時,我注意到組件集合(這是一種以控件ID爲鍵的字典)是空的。
還有什麼問題呢?順便說一句,我也在頁面上使用jQuery的東西。
非常感謝!
這兩種解決方案都無法正常工作......我是否必須爲腳本管理器設置任何特殊的功能?或者,jQuery分散了Asp AJAX的東西? – Chris 2009-12-17 11:12:20
hai chris嘗試第三個.. – 2009-12-17 11:33:31
chris BehaviorID =「newAddressModalPopup」與您的模態彈出式菜單的ID相同 – 2009-12-17 11:35:43