我创建了一个
jQuery UI模态窗体,我想要该窗体触发回发,但我有困难得到它的工作。
我知道有相当多的文章基于使用SimpleModal插件,我已经尝试适应这些和重写_doPostback函数,但没有快乐。
我认为问题是在我的__doPostBack函数的调用和什么参数应该。是这样的情况吗?
这是我的形式
<form id="summaryForm" runat="server"> <div id="dialog" title="Quick Booking"> <p>Select user from list or enter name in Box</p> <fieldset> <p><label>Is machine going out of the office?</label></p> <asp:RadioButton TextAlign="Left" GroupName="outOfOffice" Text="Yes" ID="optYes" class="radio" runat="server" /> <asp:RadioButton TextAlign="Left" GroupName="outOfOffice" Text="No" ID="optNo" class="radio" runat="server" Checked="true" /> <label for="dropLstUser">User:</label> <asp:DropDownList ID="dropLstUser" runat="server" /> <input type="text" name="txtUser" id="txtUser" value="" class="text" /> <label for="txtStartDate">Start Date:</label> <input type="text" id="txtStartDate" name="txtStartDate" class="datepicker" /> <asp:HiddenField ID="assetField" runat="server" /> <%--<button onclick="performPostBack('summaryForm')">Postback</button>--%> </fieldset> </div> //--------------------------------
这里是JavaScript代码:
<script type="text/javascript"> $(function() { $("#dialog").dialog({ bgiframe: true,height: 300,modal: true,buttons: { 'Close': function() { alert("closing"); $(this).dialog("close"); __doPostBack = newDoPostBack; __doPostBack("aspnetForm",null); } } }); }); function newDoPostBack(eventTarget,eventArgument) { alert("postingback"); var theForm = document.forms[0]; if (!theForm) { theForm = document.aspnetForm; } if (!theForm.onsubmit || (theForm.onsubmit() != false)) { document.getElementById("__EVENTTARGET").value = eventTarget; document.getElementById("__EVENTARGUMENT").value = eventArgument; theForm.submit(); } } </script>
解决方法
原文地址:https://www.jb51.cc/aspnet/254396.html
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。