jQuery UI的对话框(木代尔),prevents任何回传 [英] jQuery UI Dialog(Modal), prevents any postback

查看:107
本文介绍了jQuery UI的对话框(木代尔),prevents任何回传的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我怎样才能使一个ASP.NET的jQuery用户界面对话框提交按钮回传,而?

How can I make an ASP.NET submit button postback while in jQuery UI dialog?

其实我使用的UI对话框模式像一个大家用AJAX控件工具包的模式一样,以更新存储在GridView控件中的数据值。我能够做的每一件事,但我不能触发一个UI莫代尔回传。我有点新的jQuery和UI等等,找不到一个很好的解决方案。

Actually I am using the UI dialog modal like the one we did with Ajax control toolkit's modal, to update values of data stored in a gridview control. I am able to do every thing, but I can not trigger a postback with a UI Modal. I am a little new to jQuery and its UI so, can't find a good solution for that.

有关Ajax工具包的模式,我们用来设置触发属性,以使回发时,有人点击了提交按钮,但这里就像是不可能的。以下是我的code:

For Ajax toolkit's modal we used to set a trigger property so as to enable a postback when someone clicks on its submit button, but here it is like impossible. Following is my code:

//------------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 事件。

In the gridview I have added javascript event invokeEditPopup() to buttons (that will be used to popup the dialog), in the GridView_DataBound Event.

如何让 btnEditEvent 的对话框,使回传,从而在服务器上进行必要的处理。

How do I make the btnEditEvent of the dialog to make a postback, so as to carry out the required process on the server.

-----------------------欲了解更多信息------------------
我试图使用从想法的 jQuery UI的对话框使用ASP.NET按钮回发

-----------------------For more information------------------ I tried using ideas from jQuery UI Dialog with ASP.NET button postback.

和正下方定义的JavaScript对话框我,我尝试使用(的课程分开):

And just below defining my dialog in the JavaScript, I tried using (of-course separately):

$("#editEventModal").parent().appendTo($("form"));

//--------And---------------
$(".ui-dialog").parent().appendTo($("form"));

//--------And---------------
$("#editEventModal").parent().prependTo($("form"));

//--------And---------------
$(".ui-dialog").parent().prependTo($("form"));

但它并没有正常工作。

But it did not work correctly.

推荐答案

最后,我得到了答案:堆栈溢出问题的 一个ASP.NET按钮单击事件在不触发 的。感谢PirateKitten。

Finally, I got the answer: Stack Overflow question An ASP.NET button click event is not firing. Thanks to PirateKitten.

所有我需要做的只是增加略低于我在JavaScript中创建对话框下面,和它的工作般的魅力。

All I needed to do was just to add the following just below my dialog creation in JavaScript, and it worked like charm.

$("#editEventModal").parent().appendTo(jQuery("form:first"));

这篇关于jQuery UI的对话框(木代尔),prevents任何回传的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆