Javascript 在弹出窗口中而不是在DIV中打开新页面
我有一个Javascript 在弹出窗口中而不是在DIV中打开新页面,javascript,jquery,html,css,asp.net,Javascript,Jquery,Html,Css,Asp.net,我有一个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 5
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>
另请参见按钮单击的代码隐藏
代码隐藏
protected void btnSubmit_Click(object sender, EventArgs e)
{
ClientScript.RegisterStartupScript(this.GetType(), "uploaded", "$(document).ready(function(){$('#successmsg').dialog('open');});", true);
}
现在,我有一个名为谢谢.aspx
的页面,我想在弹出窗口中调用它
请帮助,如何做到这一点。第一种方法
protected void Button_Click(object sender, EventArgs e)
{
string string1 = "pagename.aspx" ;
string newWindow ="window.open('" + string1+ "');";
ClientScript.RegisterStartupScript(this.GetType(), "pop", newWindow, true);
}
Url字符串
var strURL="yourfilepath?string1="+string1+"&string4="+string4
然后使用window.open()
第二种方法使用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);
}
使用jquery$('#dialog').load('yourpath',function(){$(this.dialog({modal:true,height:200});});在页面中加载ajax@ArunprasanthKV:你能回答一下吗,因为我不明白。@charlietfl:用ajax怎么做?我喜欢你的第二种方法,但我有一个问题。我需要删除我现有的javascript代码吗???@Geeker你什么时候想打开一个新的弹出窗口?我想在按钮点击后打开@Geeker然后不需要担心你的javascript只需在文档中编写一个按钮点击事件处理程序函数就可以了,在里面放我的code@Geeker你已经这么做了$(“#successsg”).dialog('close');使用我的代码行
protected void Button_Click(object sender, EventArgs e)
{
string string1 = "pagename.aspx" ;
string newWindow ="window.open('" + string1+ "');";
ClientScript.RegisterStartupScript(this.GetType(), "pop", newWindow, true);
}