I'm not sure your immediate goal. It appears you want your site to part blazor and part razor.
see:
https://www.meziantou.net/integrating-blazor-components-into-razor-pages-and-mvc-apps.htm
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello,
I am looking to add dynamic routing to my Blazor server app, is this possible? Will it be possible in 6.0?
To be more clear, I have a page component (Browse.razor) that I will use to list results in a grid. When a user navigates to either /accounts or /orders, I would like this component used. I know I can do this with the @Anonymous directive, but I would like to configure this in configuration so that I may configure other uri's for this. In other words, I would like to have a completely configurable navigation that reuses a common component (Grid or Form).
I am looking to port an existing application bit by bit over to Blazor. My BA's understand the application well enough that if I were to provide them the application shell and framework to configure the navigation, API calls, validation rules and layout templates - they would then be able to reconstitute a new rendition of the existing application as a Blazor one.
It seems to me that while routes is just a collection, the @Anonymous directive is required since Blazor generates composite code during the build process. There doesn't see to be a way to assign additional routes on a page post deployment.
For now, I can use "/{area:string}/browse/{view: string}/{filters:string}" or "/{area:string}/edit/{formname: string}/{parameters:string}" for the uri and go from there. I was just wondering if there was a mechanism to add these patterns post build.
Thanks
I'm not sure your immediate goal. It appears you want your site to part blazor and part razor.
see:
https://www.meziantou.net/integrating-blazor-components-into-razor-pages-and-mvc-apps.htm