Mr Bell
Mr Bell

Reputation: 9338

How to get html from partial view from within controller

I have an e-commerce type application and when the user submits their payment I want to display a receipt page as well as a copy of the receipt in an email. Since the HTML for the receipt page and the receipt email is the same I would like use the View to generate HTML for the email.

How can I get the html from a view from within the controller?

Upvotes: 2

Views: 2057

Answers (1)

Darin Dimitrov
Darin Dimitrov

Reputation: 1038820

You may take a look at the following article. But because you mentioned emailing views you should definitely take a look at MvcMailer. Scott Hanselman also blogged about it.

Upvotes: 2

Related Questions