如何打印html表服务器控件
我遇到了一点麻烦,我需要打印一个从C#加载的HtmlTable,但是看了一眼之后,我意识到我的javascript打印函数只有在HtmlTable没有runat=“server”时才起作用,不幸的是,这意味着我无法使用C#加载它。。。那么如何打印从C#加载的HtmlTable呢?javascript打印函数如下所示。欢迎任何帮助如何打印html表服务器控件,html,asp.net,printing,Html,Asp.net,Printing,我遇到了一点麻烦,我需要打印一个从C#加载的HtmlTable,但是看了一眼之后,我意识到我的javascript打印函数只有在HtmlTable没有runat=“server”时才起作用,不幸的是,这意味着我无法使用C#加载它。。。那么如何打印从C#加载的HtmlTable呢?javascript打印函数如下所示。欢迎任何帮助 function Print() { var prntData = document.getElementById('Table1'); var myw
function Print() {
var prntData = document.getElementById('Table1');
var mywindow = window.open('', 'printer', 'height=400,width=600');
mywindow.document.write('<html><head><title></title>');
mywindow.document.write('</head><body style="direction:rtl;"><pre>');
mywindow.document.write(prntData.innerHTML);
mywindow.document.write('</pre></body></html>');
mywindow.document.close();
mywindow.print();
}
函数打印(){
var prntData=document.getElementById('Table1');
var mywindow=window.open(“”,'printer','height=400,width=600');
mywindow.document.write(“”);
mywindow.document.write(“”);
mywindow.document.write(prntData.innerHTML);
mywindow.document.write(“”);
mywindow.document.close();
mywindow.print();
}