Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

How to render at server side without @taghelper?

$
0
0

I am developing "ASP.NET Core Web API" with "Angular 4". I am following this tutorial of Microsoft.AspNetCore.SpaServices Server Side Prerendering and there are two important steps to use power `Microsoft.AspNetCore.SpaServices`:

1. go to your `Views/_ViewImports.cshtml` file, and add the following line:

`@addTagHelper "*, Microsoft.AspNetCore.SpaServices"`


2. Choose a place in one of your MVC views where you want to prerender a SPA component. For example, open `Views/Home/Index.cshtml`, and add markup like the following:

`<div id="my-spa" asp-prerender-module="ClientApp/boot-server"></div>`


But Web Api does not have `Views` folder and I cannot do above steps.

My question is can I use Microsoft.AspNetCore.SpaServices without@addTagHelper in `ASP.NET Core Web API`?


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>