如何在 jQuery UI 对话框中进行 ASP.NET 提交按钮回发?
实际上,我正在使用 UI 对话框模式,就像我们使用 Ajax 控件工具包的模式所做的那样,来更新存储在 gridview 控件中的数据值。我可以做所有事情,但无法使用 UI 模态触发回发。我对 jQuery 及其 UI 有点陌生,所以找不到一个好的解决方案。
对于Ajax工具包的模态,我们曾经设置一个触发器属性,以便在有人单击其提交按钮时启用回发,但在这里这是不可能的。以下是我的代码:
//------------Modal first----------------
<div id="editEventModal" title="Edit Event Details" style="display:none">
//-------Here are my controls with asp.net validators
<asp:Button ID="btnEditEvent" runat="server" Text="Save" ValidationGroup="EditEvent" />
</div>
//--------- JavaScript/jQuery method for calling popup
function invokeEditPopup(){
$("#editEventModal").dialog({
width: 700,
modal: true
});
}
//-- Please not that I have not used UI_Dialog's predefined `OK`, `Cancel` buttons as I need to validate my form with asp.net validators on submit button's `click` event.
在 gridview 中我添加了 javascript 事件invokeEditPopup()
按钮(将用于弹出对话框),在GridView_DataBound
Event.
我该如何制作btnEditEvent
的对话框进行回发,以便在服务器上执行所需的处理。
- - - - - - - - - - - -了解更多信息 - - - - - - - - -
我尝试使用来自的想法带有 ASP.NET 按钮回发的 jQuery UI 对话框 https://stackoverflow.com/questions/757232.
在 JavaScript 中定义对话框的下方,我尝试使用(当然是单独的):
$("#editEventModal").parent().appendTo($("form"));
//--------And---------------
$(".ui-dialog").parent().appendTo($("form"));
//--------And---------------
$("#editEventModal").parent().prependTo($("form"));
//--------And---------------
$(".ui-dialog").parent().prependTo($("form"));
但它无法正常工作。