I use some rendercontrollers to make some code and template separation for some pages. The pages loads data from an external database and now I wonder if there any way to hijack the render of an blockgrid item?
I know I can just place the code in the razor template, but I want to have as little code as possible in the razor and load models with all needed data.
I tried to do it like I do for the page with a RenderController without success
public class FollowOrderBlockController : RenderController {
...
public async Task<IActionResult> FollowOrderBlock(FollowOrderBlock model)
{
var myData = await myManager.GetTheData();
model.MyData = myData;
return View(model);
}
}
On some other places I have "solved" this by making a component and call that from the block.
@(await Component.InvokeAsync("MyComponent"))
But on this block that's not an option
Is there a way to do this, or does this not get routed the same way?
Hijack the BlockGridItem render
I use some rendercontrollers to make some code and template separation for some pages. The pages loads data from an external database and now I wonder if there any way to hijack the render of an blockgrid item?
I know I can just place the code in the razor template, but I want to have as little code as possible in the razor and load models with all needed data.
I tried to do it like I do for the page with a RenderController without success
On some other places I have "solved" this by making a component and call that from the block.
But on this block that's not an option
Is there a way to do this, or does this not get routed the same way?
is working on a reply...