弹出窗口无法在代码后面打开

时间:2017-02-13 05:38:20

标签: c# asp.net

打开弹出窗口后,我需要重新加载我的页面。此页面重新加载但弹出窗口未打开。如何解决它。

string url = "Popup.aspx";
string s = "window.open('" + url + "', 'popup_window', 'width=300,height=100,left=100,top=100,resizable=yes');";
ClientScript.RegisterStartupScript(this.GetType(), "script", s, true);
Response.Redirect("~/mysamepage.aspx", false);

1 个答案:

答案 0 :(得分:1)

您是否在javascript中尝试了重新加载,方法是将其附加到window.location.reload(false); // If you need to fetch the webpage from the web-server again (where the page //contents change dynamically) pass the argument as 'true' instead of 'false'. 字符串:

string s = "window.open('" + url + "', 'popup_window', 'width=300,height=100,left=100,top=100,resizable=yes');window.location.reload(false);";

例如

window.opener.href('url').reload(true);

或尝试:

local json = require( "json" )
local inspect = require("inspect")
local myjson_str='{"Sms":{"key":"xxxxxxxxxxxxxxxxxxxxx","to":"{caller}","senderid":null,"type":"Simple","content":"Your request has been accepted in Previous Miss call. We get back to you very soon."}}'

local myjson_table = json.decode(myjson_str)
print(type(myjson_table["Sms"]["senderid"]))
print(myjson_table)
print(inspect(myjson_table))
print(json.encode(myjson_table))