Thursday, April 26, 2012

how to get print mode and export the controls using javascript

 <script type="text/javascript">


             function printdiv(printpage)
              {
                 var headstr = "";

                 var footstr = "";
                 var newstr = document.all.item(printpage).innerHTML;
                 var oldstr = document.body.innerHTML;
                 document.body.innerHTML = headstr + newstr + footstr;
                 window.print();
                 document.body.innerHTML = oldstr;
                 return false;
             }

     < /script>



    < input type="button" value="print" onclick="printdiv('print_area');" />