I have a simple ViewComponent (i.e. partialview) which i can do an InvokeAsyn() to render a small snippet of HTML by placing the invoke code within my CSHTML.
Question
How can I call a ViewComponent InvokeAsync (or any method) to retrieve raw data (not necessarily HTML markup) from javascript?
Alternatively
An alternative approach that could totally work is exposing an Asp.net Core API which i can simply call from javascript side.
You can not call view components using http(Ajax) but you can have action method on controller will can return view component out put as resut