[DevExpress Support Team: CLONED FROM T939883: Blazor - How to show a fully custom non-XAF web form (with custom controls, JavaScript, Razor components, etc.)]
Hello,
I am using IJSInterop to redirect new browser tab.
This below App.razor is customized as you shown in above response which is working as expected.
Razor<Router AdditionalAssemblies="new[] {typeof(Program).Assembly}" AppAssembly="typeof(DevExpress.ExpressApp.Blazor.BlazorApplication).Assembly">
<Found Context="routeData">
<RouteView RouteData="@routeData" />
</Found>
<NotFound>
<LayoutView>
<p>Sorry, there's nothing at this address.</p>
</LayoutView>
</NotFound>
</Router>
And for this by default App.razor page I am getting Page not found error(MessageOption).
Razor<Router AppAssembly="@typeof(Program).Assembly" AdditionalAssemblies="new[] { typeof(DevExpress.ExpressApp.Blazor.BlazorApplication).Assembly }">
<Found Context="routeData">
<RouteView RouteData="@routeData" />
</Found>
<NotFound>
<LayoutView>
<p>Sorry, there's nothing at this address.</p>
</LayoutView>
</NotFound>
</Router>
Can you clarify, if this modification in App.razor page generates any side effects or not?
Hello,
You need to customize the App.razor page in the same way as demonstrated in Gosha's answer. This should not cause side-effects. If this does not help, please send us a simple compilable project that contains only problematic pages (see A request for simple example programs) and illustrates your current attempts and the issue in action. We will research it and give you further recommendations.
Thanks,
Stanley
Hello Stanley,
Thank you for your kind response,
First I had made changes in App.razor file according Gosha's answer and that was working fine. After that I had undo those App.razor page changes and still it was working like previous changes.
And then I keep the App.razor page as same as it was:
<Router AppAssembly="@typeof(Program).Assembly" AdditionalAssemblies="new[] { typeof(DevExpress.ExpressApp.Blazor.BlazorApplication).Assembly }"> <Found Context="routeData"> <RouteView RouteData="@routeData" /> </Found> <NotFound> <LayoutView> <p>Sorry, there's nothing at this address.</p> </LayoutView> </NotFound> </Router>
Hello Yartik,
If I understand it correctly, you did not face any issues. As for the App.razor template, the routing order was slightly changed: the assembly specified via the
AppAssembly
attribute is processed first, then additional assemblies specified via the AdditionalAssemblies parameter are scanned. For additional details, please refer to Route to components from multiple assemblies.This should not cause any side-effects. Let us know if you need further clarification.
Thanks,
Stanley