Render ASP.NET MVC for viewing without HttpContext or ControllerContext?

I need to display an ASP.NET MVC view for a string in order to be able to send it by email (this is an order confirmation email defined in the .ascx file).

I was able to successfully map ASP.NET MVC View to a string using one of the methods in question .

However, now I need to be able to do this through the WCF service (which I will access through silverlight), and therefore I do not ControllerContext. This WCF service is contained in the same project as my MVC project, and has access to all my models, etc.

I reviewed a few Stackoverflow questions about this issue, but they all seem to need a controller context. I thought there was something in mvccontrib, but it doesn't seem to exist anymore .

The closest I found is the accepted answer to the above question , but unfortunately it breaks with RenderPartial in the view you are viewing.

I hope some of the header work for ASP.NET MVC 2 related to RenderAction can help make this possible now?

+3
source share
2 answers

, - MVC, , / ASP.NET, .

( WFVE ) WCF. Spark.

+1

ControllerContext, ?

+1

Source: https://habr.com/ru/post/1727126/


All Articles