2

I have a partial view in my web application that renders a "widget" with several fields. Besides displaying the widget in the site I am sending it through email, and this works for some of the email clients, but some don't understand the inline CSS correctly.

I was thinking on rendering the partial view on the server and creating a single image from it, then embeding the image in the email, this way everyone will see the widget in the same way.

Is there a way to render a partial view on the server side and create an image from it? If so, where can I get more info about it? I've googled it and I don't seem to find any relevant information.

Thanks

willvv
  • 8,439
  • 16
  • 66
  • 101
  • A bit old, but relevant: http://stackoverflow.com/questions/186062/can-an-asp-net-mvc-controller-return-an-image – Robert Harvey Apr 30 '12 at 18:16
  • Also relevant: http://blog.maartenballiauw.be/post/2008/05/ASPNET-MVC-custom-ActionResult.aspx. I don't know if ASP.NET MVC 3 now has something like this built in natively. – Robert Harvey Apr 30 '12 at 18:16
  • Related: http://stackoverflow.com/questions/5172380 – Robert Harvey Apr 30 '12 at 18:18
  • Actually that's not what I'm looking for, I'm trying to create an image of my html/css/images, basically a screenshot of my partial view. – willvv Apr 30 '12 at 18:19
  • 1
    In that case: http://stackoverflow.com/questions/968201/convert-web-page-to-image – Robert Harvey Apr 30 '12 at 18:20
  • How often is the widget updated? – Uchendu Nwachuku Apr 30 '12 at 18:27
  • @RobertHarvey Ok, that's close, I was thinking on a .NET library that could do that, I guess I'll research those standalone apps to see if they can be used in my hosting server. – willvv Apr 30 '12 at 18:31
  • @UchenduNwachuku The widget is completely dynamic, i.e. It represents a user of the system, something like the box with the information about the user here in SO (picture, username, points, badges, etc) – willvv Apr 30 '12 at 18:32
  • @willvv In that case, I doubt there is any viable way to do what you are asking in the way you're trying to do it. – Uchendu Nwachuku Apr 30 '12 at 18:44
  • @willvv Instead, I think you need to investigate rendering the widget using the `System.Windows.Media.Imaging` namespace to create an image of the widget on the server side. – Uchendu Nwachuku Apr 30 '12 at 18:52

0 Answers0