【发布时间】:2013-01-11 18:59:36
【问题描述】:
在某个时刻,我的代码隐藏中有一个动态生成的带有 html 的字符串。
我想打开一个以该 html 为源的弹出窗口。
我尝试了以下方法:
我在我的.aspx 网站(Javascript)上创建了这个方法:
function OpenWindowWithHtml(html, title) {
var myWindow = window.open('', title);
myWindow.document.write(html);
myWindow.focus();
}
在代码隐藏中我有这个:
Response.Write("OpenPopupWithHtml(\"" + html + "\", \"" + title + "\");");
但是当我尝试执行此操作时出现错误。
有没有人看到,我在这里做错了什么?
或者有人知道更好的方法吗?
【问题讨论】:
标签: c# javascript asp.net popup code-behind