Friday, 19 October 2012

print panel in javascript , print contoll in asp.net c#




-------------------------------------------------
<script language="javascript" type="text/javascript">
   
    function Button1_onclick()
  {
    window.print();
  }
   
    </script>
--------------------------------------------------------

-----------------------------------------------------------------
<input id="Button1" onclick="return Button1_onclick()" style="width: 113px" type="button" value="Print" />
------------------------------------------------------------



-----------------------------------------------------
<html>
<script type="text/javascript">
function printMe()
{
var content=document.getElementById('yourPanelClientID');

//open blank page and put the rendered HTML text inside
w=window.open('about:blank');
w.document.open();
w.document.write("<html>" + content.innerHTML);
w.document.writeln("<script>window.print()</"+"script>");
w.document.writeln("</html>");
w.document.close();
}
</script>

</html>

--------------------------------------------------

No comments:

Post a Comment