Ticket T1019273
Visible to All Users

Blazor - A "Page not found" error occurs on an attempt to render a custom non-XAF web form

created 4 years ago (modified 4 years ago)

[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?

Comments (3)
DevExpress Support Team 4 years ago

    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

    YD YD
    Yartik Dhameliya 4 years ago

      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:

      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>
      DevExpress Support Team 4 years ago

        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

        Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

        Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.