有關主題的StackOverflow上有幾個職位,但沒有答案幫助我。 我正在使用通過DataAdapter由SELECT填充的DataList控件。 一個概念建議只有一個對話框的實例必須是開放的,但不能應用此方法JQuery對話框 - 不開放第二次
的HTML的結構是:
<asp:DataList ID="DataList" runat="server">
<ItemStyle />
<ItemTemplate>
<a href="" class="link"/></a>
<div class = "dialog" id="dynamicID" style="display:none">
</ div>
</ ItemTemplate>
</ asp: DataList>
我使用jQuery的代碼是:
<script language="javascript" type="text/javascript">
$ (function() {
$ (". link. ") click (function() {
var id = '#' + ($ (this). siblings ('. dialog'). attr ('id'));
$ (id). dialog ({
AutoOpen: false,
closeOnEscape: true,
resizable: false,
draggable: false,
modal: true,
width: 800,
height: 600,
overlay: {backgroundColor: "# 000", opacity: 0.5},
top: 20,
show: 'fade',
hide: 'fade',
buttons: {
"Close": function() {
$ (id). dialog ('close');
}
}
});
$ (id). dialog ('open');
});
});
</ script>
[jQuery的用戶界面對話框不開放的第二時間]的可能的複製(http://stackoverflow.com/questions/8700495/jquery-ui-dialog-not-opening-a-second-time) – RMalke 2016-01-30 21:22:31