I working on a project and I would like to have a printer friendly version of the Views I have. Is there anybody who already did this and have some tips how to accomplish this? (what kind Routing is used, etc.)
I was thinking of making a PrintController. In the ActionResult of a method in the PrintController to return a View with a specific masterpage.
public ActionResult Index(string printView)
{
return View(@"~/Views/Product/Index", "PrinterFriendly_MasterPage");
}
Stephan Walter doesn't advice to use this kind of redirecting (tip #24) because it is not the way MVC was meant to be.
On the View there will be a link to print the page, e.g.:
- normal link: www.example.com/product;
- print link: www.example.com/print/product;
I don't want to use javascript or AJAX. Just show the same View the user is watching, only with a different masterpage (which will have specific print stylesheets).