.NET Development
Blazor error Sorry, there's nothing at this address.
Gravatar is a globally recognized avatar based on your email address. Blazor error Sorry, there's nothing at this address.
  Nick
  All
  Apr 25, 2023 @ 04:03am

I have created a Blazor Webassembly in VS 2022 .net 7, using the default template, I will be using it to do some testing. However, I'm running into an issue, I create a simple Component Page \Pages\DialogTestPage.razor and the code looks like this

Code for DialogTestPage.razor

@page "/dialogtestpage"

<PageTitle>Alert</PageTitle>

<h3>Dialog Test Page</h3>

@code {

}

Navmenu.rezor code

<div class="top-row ps-3 navbar navbar-dark">
    <div class="container-fluid">
        <a class="navbar-brand" href="">BlazorWAModalDialog</a>
        <button title="Navigation menu" class="navbar-toggler" @onclick="ToggleNavMenu">
            <span class="navbar-toggler-icon"></span>
        </button>
    </div>
</div>

<div class="@NavMenuCssClass nav-scrollable" @onclick="ToggleNavMenu">
    <nav class="flex-column">
        <div class="nav-item px-3">
            <NavLink class="nav-link" href="" Match="NavLinkMatch.All">
                <span class="oi oi-home" aria-hidden="true"></span> Home
            </NavLink>
        </div>
        <div class="nav-item px-3">
            <NavLink class="nav-link" href="counter">
                <span class="oi oi-plus" aria-hidden="true"></span> Counter
            </NavLink>
        </div>
        <div class="nav-item px-3">
            <NavLink class="nav-link" href="fetchdata">
                <span class="oi oi-list-rich" aria-hidden="true"></span> Fetch data
            </NavLink>
        </div>
        <div class="nav-item px-10">
            <NavLink class="nav-link" href="dialogtestpage">
                <span class="oi oi-list-rich" aria-hidden="true"></span> Modal Dialog Boot Strap
            </NavLink>
        </div>
    </nav>
</div>

@code {
    private bool collapseNavMenu = true;

    private string? NavMenuCssClass => collapseNavMenu ? "collapse" : null;

    private void ToggleNavMenu()
    {
        collapseNavMenu = !collapseNavMenu;
    }
}

When I select the option Modal Dialog Boot Strap, I get the following results.

Here is what I have try to fix this issue.

  1. Clean the solution
  2. Rebuild solution
  3. check routing in the App.razor
  4. Uninstalled VS 2022 and reinstalled. (Version 17.5.4 running on windows 10 and 11)
  5. Tryed using one of my other computers, with the same result
Gravatar is a globally recognized avatar based on your email address. re: Blazor error Sorry, there's nothing at this address.
  Rick Strahl
  Nick
  Apr 26, 2023 @ 10:24am

Recompile?

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Blazor error Sorry, there's nothing at this address.
  Nick
  Rick Strahl
  Apr 27, 2023 @ 04:58am

Hi Rick, thank you for your response. I did a Recompile (by doing a rebuild, still have the same issue)

Have a nice Weekend

Gravatar is a globally recognized avatar based on your email address. re: Blazor error Sorry, there's nothing at this address.
  khaydar
  Nick
  Jun 23, 2023 @ 12:11am

I have solved this problem. I think you created the file as RazorComponent. You need to copy the example file (Counter) and change it the way you want

Gravatar is a globally recognized avatar based on your email address. re: Blazor error Sorry, there's nothing at this address.
  Nick
  khaydar
  Jun 26, 2023 @ 02:37am

Sorry for the delay, but I was at KCDC. Thank you. I will give it a try.

© 1996-2024