ASP.NEt MVC using Web API to return a Razor view

前端 未结 3 699
广开言路
广开言路 2020-12-02 17:47

How to make the View returned by the controller and generated by Razor get the data from the api i want to keep the razor engine view and use the api the original mvc cont

3条回答
  •  孤街浪徒
    2020-12-02 18:23

    Read here on how to use the Razor view engine inside your Web API controller. The interesting part is using the RazorEngine NuGet package to do the heavy lifting.

提交回复
热议问题