I have a razor page in the .net 8.0 web app client-side project, which injects Radzen Dialog Service. I set render mode web assembly (pretender: false) at this page head. But Dialog Service cannot trigger OpenAsync(). I debugged it and found OnOpen() event is null.
For testing only, If I set the render mode is InteractiveServer both the main layout file and the razor page head. It seems working.
However, I have another data grid component on this page. It seems to work well only if I set the page Web Assembly render mode to communicate with the business layers of the server side via the HttpClient class. So, I cannot set the DataGrid component WebAssembly render mode, at the same time, set Interactive Server on the page to keep DialogService working. What did I do something wrong?
Just indjecting the service is not enough - you need to declare RadzenDialog in your layout. There are more components like notifications, tooltips, etc with similar requirements - better check our getting started.
Thanks for your reply. Yes, according to the official document of getting started, Both RadzenComponents and RadzenDialog have been declared in the MainLayout.razor file at the server-side project with an implicit render mode. Additionally, both sides program.cs and _imports.cs and app.razor at the server side have been configured properly.
I declared InteractiveWebAssembly at the head of this client-site page for Radzen Datagrid. It's not sure if it impacts the Dialog Service open event. Dialog service is still not working at the moment. Should Dialog Service only set InteractiveServer render mode? Thanks.
RadzenComponents/RadzenDialog will inherit the rendermode from the layout if bot set explicitly. The component will not work only if the render mode is static.
Wow, Thank you for giving me a lot of confidence to solve this issue.
I try to declare the attribute: @rendermode=@InteractiveWebAssembly explicitly at the <RadzenComponents> tag in the "MainLayout.razor" file of the server-side project, it's just like declaring render mode on the client razor page where DialogService is injected.
It seems both of them have a consistent declaration. It's working well.