Reputation: 2783
I'm working on the MVC app where I've to generate the report in the form of HTML page. If the user click the print icon, I've to show the HTML page to user. If the user click on email icon, I've to send email with same HTML page attachment. I'm trying to find a way where I can use the same code to generate the HTML in both cases of email and print. Please provide your suggestions.
Upvotes: 0
Views: 489
Reputation: 13083
What you really want and did not know how to formulate is Render view to string. Then you can do whatever you want with the contents of that string.
Start here Render a view as a string
but this subject continues in many other questions too (or you can Google it) and you will discover much more information.
Upvotes: 1
Reputation: 9078
Your Controller has to decide what to do.
Upvotes: 0