开发者

Print Page functionality in MVC [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clari开发者_如何学JAVAfying this question so that it can be reopened, visit the help center. Closed 10 years ago.

Anyone done this in MVC? any info would be great!. Thanks.


You can get pretty far simply by including a print.css file for media type print.

Hide everything you don't want and include logical page breaks and demensions (inches, etc... actually format more correctly using the print.css override).

I have used a custom controller (or filter) to handle links using something like index.print instead of index.html, which simply overrides the master layout with a layout more suitable for printing, but I still feel that the alternate stylesheet is the best way to go.

http://www.alistapart.com/articles/goingtoprint/


Printing a page isn't really a matter for ASP .NET or MVC. Printing is a client-side operation, and therefore can (and should) be done entirely in client-side code. JavaScript has a method call for this:

window.print()
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜