aspnetcore: RazorComponentResult returned component cannot execute clientside code
Hi I want to return a Razor Component from a controller. (.net 8 RC1, newest Blazor WebApp Template)
public IResult CRT()
{
return new RazorComponentResult<Components.Components.Counter>();
}
I have a simple test component (the infamous Counter.razor) with @attribute [RenderModeServer] Returns correct rendered component But counter event is not triggered:
- Not available for components returned with RazorComponentResult? Mere HTML rendering as standard Blazor 8 SSR ?
- Will be available in RC2 / RTM
- if not, how to have a MVC Architecture with clientside code for Blazor 8 ?
BTW: The same behaviour if I use the component inside a Razor page (cshtml) with @await Component.InvokeAsync(“Counter”); So has this maybe to do with that these calls cannot handle the new @attribute [RenderModeServer] ?
Thanks for information, Michael
About this issue
- Original URL
- State: closed
- Created 9 months ago
- Reactions: 1
- Comments: 22 (2 by maintainers)
FYI. I got WebAssembly working as well. So added endpoint for that.
https://github.com/marinasundstrom/BlazorMinimalApiTest/blob/main/README.md
@marinasundstrom Thanks for letting me know. Currently we have not used and short term foreseeably don’t intent to use WASM. So I will wait and see, what the team will come up with in RC2 and RTM. I hope they will clarify and document the state of affairs with regard the topics we discussed and You researched. And your distraction from whatever was at any rate very helpful for me, to see what the current state is with regard to my initial motivation.