Mvc displays partial view without httpContext or controller context

Is it possible to display a partial view without a ViewContext or ControllerContext?

  • I am trying to get PartialView Html as a string due to Controller action.
  • OR
  • Can I call a Controller Action from another method? (this will allow me to perform a controller action and get a partial view of html this way).
+4
source share
1 answer

You can try the Razor Generator Visual Studio Extension. Basically you run a custom tool in your view and generate a class to which you can pass the model, and it will generate a string.

+3
source

All Articles