Replies: 1 comment 7 replies
-
I think I figured out the issue, and a fix. In the .NET 8 default project, pages are static unless explicitly set to be InteractiveServer (essentially like the "Server" mode in .NET 6). Even if you set rendering explicitly in individual files, the MainLayout etc won't have that interactive functionality. You can set the old style .NET 6 "always on" connection behaviour globally from the routes tag in the App.razor. <Routes @rendermode="RenderMode.InteractiveServer" /> Also, do the same to the HeadOutlet in the App.razor: <HeadOutlet @rendermode="RenderMode.InteractiveServer" /> After this, the Blazored.Modal dialogs work as expected. One thing to note however is that this breaks the Account pages in the identity system, they will generate errors. But the issue is noted on the aspnetcore Github bug list and supposedly this will be fixed with the GA release. I think they will force the Account pages to run statically, regardless of the Routes tag. So for now, I am setting that rendermode to interactive so I can get all my old .NET 6 functionality into .NET 8 and will wait for GA to fix the account pages. |
Beta Was this translation helpful? Give feedback.
-
First off, have used this package in .NET6 for a year or so and have found it simple to use and reliable. Great work!
I am in the process of upgrading my .NET6 Blazor project to .NET 8 (rc2) and have found quite a few more breaking changes than I expected. Even in areas I didn't think would break. One of those appears to be Blazored.Modal. Have set things up in the same way, using latest package, but it just gives a null instance error when I try to launch a popup.
I have tried the CascadingBlazoredModal tags in both the App and Routes .razor components as the wiring in .NET is a little different, but doesn't seem to matter. There are no build errors, the error only occurs at run time when a model is triggered.
I would not rule out the possibility I am doing something wrong, just wasn't sure if anyone has got the existing package working with Blazor server .NET 8 (I have stuck to just the server version to try to keep things as similar as possible to the existing .NET project), or if there are changes required for .NET 8?
Beta Was this translation helpful? Give feedback.
All reactions