asp.net – jQuery模态窗体对话框回发问题
发布时间:2020-05-23 07:12:23 所属栏目:asp.Net 来源:互联网
导读:我创建了一个 jQuery UI模态窗体,我想要该窗体触发回发,但我有困难得到它的工作。 我知道有相当多的文章基于使用SimpleModal插件,我已经尝试适应这些和重写_doPostback函数,但没有快乐。 我认为问题是在我的__doPostBack函数的调用和什么参数应该。是这样
|
我创建了一个 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>
解决方法创建对话框后,只需将对话框移回表单即可。例:$("#divSaveAs").dialog({bgiframe:false,autoOpen:false,title:"Save As",modal:true});
$("#divSaveAs").parent().appendTo($("form:first"));
这对我有用。回发工作发现。 (编辑:安卓应用网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- asp.net-mvc – 可以浏览DataAnnotations的自定义Html帮助器
- ASP.NET FileUpload:如何在选择文件后自动回复?
- asp.net-mvc – ASP.NET MVC的生产力?
- asp.net-mvc – 如何在asp.net C#中从http重定向到https并将
- 在ASP经典中编写JavaScript
- asp.net – HttpRequest,HttpWebRequest和WebRequest之间的
- asp.net-core-mvc – 如何在Asp.net Core MVC(又名Asp.Net
- asp.net – 链接按钮不能与IE 10一起使用
- asp.net-mvc – 允许使用数字中的点和逗号,而不仅仅是小数
- asp.net-mvc – 如何全局化ASP.NET MVC视图(特别是小数分隔
推荐文章
站长推荐
- asp.net – 在Response.End之前使用Response.Flu
- ASP.NET中的Akka.NET actor系统
- asp.net-mvc-3 – 为什么@ Html.Label()删除一些
- asp.net-mvc – 从MVC中的控制器确定部分视图的模
- asp.net-mvc – 使ASP.NET绑定指定media =屏幕的
- asp.net-mvc – asp.net mvc 3 webgrid排序依然?
- msbuild – 如果不指定目标框架,则不支持“发布”
- asp.net-mvc-4 – GoogleOauth2问题获取Internal
- asp.net – 使用回发解析.Net页面
- asp.net – 如何删除linq到sql?
热点阅读
