I'm wondering whether there's a way that I can instantiate an object or call a utility function that will simply take in an object and perhaps a path to a view as parameters, and return a string that consists of the rendered view
, using the object as the model
.
I don't want to go through the usual ASP.NET
request pipeline, or deal with dependency injection
or even depend on the framework running to provide a bunch of services.
I simply want an easy way to render a view to a string in code.
Does this exist?
If anyone knows of any good sources on how view rendering in ASP.NET
works under the hood, that would also be very helpful.