如何打印指定的div(无需手动禁用页面上的所有其他内容)?
我想避免使用新的预览对话框,因此使用此内容创建新窗口无用.
该页面包含几个表格,其中一个表格包含我要打印的div - 该表格采用网页的视觉样式设计,不应该以打印方式显示.
试过这样的事情:
HttpApplication app = s as HttpApplication; //s is sender of the OnBeginRequest event
System.Web.UI.Page p = (System.Web.UI.Page)app.Context.Handler;
System.Web.UI.WebControls.Label lbl = new System.Web.UI.WebControls.Label();
lbl.Text = "TEST TEST TEST";
p.Controls.Add(lbl);
Run Code Online (Sandbox Code Playgroud)
运行时,我得到"对象引用未设置为对象的实例".为最后一行......
如何在原始文件中的特定loactions处插入两行文本(asp.net/html)?我怎么弄清楚文件的扩展名(我只想在aspx文件上应用这个...?
<document.write("<SCR"+"IPT TYPE='text/javascript' SRC='"+"http"+(window.location.protocol.indexOf('https:')==0?'s':'')+"://"+gDomain+"/"+gDcsId+"/wtid.js"+"'><\/SCR"+"IPT>");
Run Code Online (Sandbox Code Playgroud)
我需要转义上面的字符串,以便将整个事物添加到StringBuilder但到目前为止我必须丢失一些东西,因为字符串终止不正确...