gpt4 book ai didi

javascript - 在弹出窗口而不是 DIV 中打开一个新页面

转载 作者:行者123 更新时间:2023-11-28 08:22:26 25 4
gpt4 key购买 nike

我有一个DIV,它在提交表单后打开点击按钮。 div代码在下面

<div id="successmsg" style="font-family: 'signika_negativeregular', sans-serif; font-size: 0.9em;">

<div style="height: auto; margin-bottom: 10px; color: #193284; padding: 5px 5px 5px 5px; font-size: 15px; background: url(images/common/header-bottom-line.png) no-repeat bottom left; font-weight: bold; line-height: 1.5em;">
<div id="divTitle1" runat="server"></div>

<div style="width: 434px; margin-bottom: 10px; line-height: 1.7em; text-align: justify; font-size: 14px; font-family: 'signika_negativeRegular', sans-serif; color: #666; margin-top: 10px;">
<div class="readmoreNew2">
We appreciate and acknowledge your interest shown towards RBL Bank.<br />
Our team would get back to you soon.
</div>
</div>

<input type="button" id="btnOk" value="OK" class="btnDropbox" style="background: #CF060D; font-family: 'signika_negativesemibold', sans-serif; color: #ffffff; font-size: 15px; font-weight: 500; text-transform: uppercase; border: none; padding: 5px 11px 5px 9px; cursor: pointer;" />
</div>

</div>

它看起来像 this .

在弹出窗口中打开它的代码在下面的 JS 和按钮点击的代码隐藏中给出,

JavaScript 代码

 $(document).ready(function () {
$("#successmsg").dialog({
autoOpen: false,
height: 230,
width: 580,
modal: true,
open: function () {
$('#btnClose').click(function () {
$("#successmsg").dialog('close');
});
},
beforeClose: function (event, ui) {
location.href = "Career.aspx";
}
});
$("#btnOk").on("click", function () {
$("#successmsg").dialog('close');
});
$('.ui-dialog .ui-dialog-titlebar').css({ 'background': 'none', 'display': 'none' })
});

另见按钮点击的代码隐藏

代码隐藏

protected void btnSubmit_Click(object sender, EventArgs e)
{
ClientScript.RegisterStartupScript(this.GetType(), "uploaded", "$(document).ready(function(){$('#successmsg').dialog('open');});", true);
}

现在,代替 div。我有一个名为 Thanks.aspx 的页面,我想在弹出窗口中调用它。

请帮忙,如何做到这一点。

最佳答案

第一种方法

网址字符串

var strURL="yourfilepath?string1="+string1+"&string4="+string4

然后使用window.open()

 var mywindow = window.open(strURL,'','width=690,height=1000,scrollbars=1,resizable=1,top=10,left=200');

第二种方法使用jquery

 $('#dialog').load('yourpath', function() { $(this).dialog({ modal: true, height: 200 }); });

第三种方法

protected void Button_Click(object sender, EventArgs e)
{
string string1 = "pagename.aspx" ;
string newWindow ="window.open('" + string1+ "');";
ClientScript.RegisterStartupScript(this.GetType(), "pop", newWindow, true);
}

关于javascript - 在弹出窗口而不是 DIV 中打开一个新页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28696656/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com