簡體   English   中英

在彈出窗口中打開一個新頁面而不是DIV

[英]Open a NEW page in a pop up instead of a DIV

我有一個DIV ,在button click提交表單后打開。 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>

它看起來像這樣

在彈出窗口中打開它的代碼在下面的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);
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM