2
Reply

print aspx page

salim

salim

Sep 10 2008 8:07 AM
15.1k
hello

i am able to print a aspx page  with below code ,when i click  print button  then at  very first a window open(actually  this is the window which  to be print ) but here this is not so good to open a window   so how we give  a print command  direct to a page

 function print_bill(eid)
    {
    var area=document.getElementById(eid);
    var pwindow=window.open("","","scrollbars=1,menubar=1,status=0,resizable=0");
    var pwindow.document.write('<LINK href="finalucg.css" type="text/css" rel="stylesheet">'   );
     //pwindow.document.write("scrollbars=1,menubar=1,status=0,resizable=0");
    pwindow.document.write(area.outerHTML);
    pwindow.document.close();
    pwindow.focus();
    pwindow.print();
    pwindow.close();
    }

Answers (2)