dialog中只要加上jquery
appendTo:"form",
就能解決後端沒法獲取asp.net控件的值,同時解決了後端
modal: true,
啓動模式對話框時沒法操做對話框。app
jquery ui dialog代碼:asp.net
$(document).ready(function() { $( "#dialog" ).dialog({ autoOpen: true, appendTo:"form", height: 250, width: 300, modal: true, buttons: { 肯定: function() { $("#btnCM").click(); }, 取消: function() { $( this ).dialog( "close" ); } } }); });
DIV代碼:ui
<div id="dialog" title="選擇練習層面"> <p align="center" <asp:TextBox ID="txtA" runat="server"></asp:TextBox> </p> </div>
或者可以使用this
$("#dialog").dialog().parent().appendTo($("form:first"));
能夠解決後端獲取控件值,但不能解決模式對話框的問題。spa