Reputation: 1770
I'm using RazorEngine to render and parse some cshtml programmatically (and get html). I need to pass programmatically some data (a list of object) to a template and use these objects inside this template.
How to pass these data and how to use them inside my template, and then parse it?
Thanks!
Upvotes: 0
Views: 671
Reputation: 525
You have to cast the objects going into the template.
ViewData is used to pass data from controller to corresponding view.
ViewData vs ViewBag vs TempData vs Session
There is also a video tutorial.
Upvotes: 1