Hướng dẫn javascript printer control
Ý tưởng là đặt các nội dung được in bên trong điều khiển ASP.Net Panel và sau đó in nội dung trong đó. Show Trong Markup HTML ở trên tôi có control panel pnlContents có nội dung cần in và nút btnPrint trong đó có sự kiện OnClientClick gọi phương thức JavaScript PrintPanel() để in nội dung của Panel. There may be times in which your website or application would like to improve the user's experience when printing content. There are a number of possible scenarios: There may be other cases in which you want to manage the printing process, but these are some of the most common scenarios. This article provides tips and techniques for helping your web content print better. Add the following to your Detecting print requestsBrowsers send ExamplesHere are some common examples. Open and automatically close a popup window when finishedIf you want to be able to automatically close a popup window (for example, the printer-friendly version of a document) after the user prints its contents, you can use code like this:
View Live Examples Print an external page without opening itIf you want to be able to print an external page without opening it, you can utilize a hidden
Note: Older versions of Internet Explorer cannot print the contents of a hidden See also |