MVC4 Jquery Page Print

Source: Internet
Author: User

<script src= "~/scripts/js/dist/jquery.jqprint-0.3.js" ></script>

<script type= "Text/javascript" >
$ (function () {
        
function Loadprintdata ()
        {
$ ("#dttoexcel"). Show ();
$ ("#dttoexcel"). Jqprint ();
return false;
        }

//Page printing function
$ ("#printBtn"). Click (function () {
var Processid = $ ("#Process_PTR"). Children (' option:selected '). Val ();
ProcessName = $ ("#Process_PTR"). Children (' option:selected '). Text ();
var begintime = $ ("#beginDate"). Val ();
var lasttime = $ ("#lastDate"). Val ();
$.ajax ({
type: "POST",
URL: '.. /assay_billmain/loadassayinfo ',
Async:true,
dataType: "Text",
error:function (Request) {
alert ("Please identify the data first");
                },
beforesend:function () {
$ ("#dttoexcel"). Hide ();
$ ("#exportBtn"). attr ({"Disabled": "Disabled"});
$ ("#printBtn"). attr ({"Disabled": "Disabled"});
                },
success:function (data) {
$ ("#dttoexcel"). Show ();
$ ("#dttoexcel"). HTML (data);
loadprintdata (data);
$ ("#dttoexcel"). Hide ();
$ ("#exportBtn"). Removeattr ("Disabled");//The button is available
$ ("#printBtn"). Removeattr ("Disabled");//The button is available
                }
            });
//Prevent Ajax page from being refreshed after submission
return false;
        });
    });

</script>

<button id= "printbtn" role= "button" class= "btn btn-info btn-small" >
<i class= "Icon-print icon-white" ></i> printing
</button>

MVC4 Jquery Page Print

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.