Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

[Blazor Razor pages I am working on the login/register of a website and these error codes popped up: CS0120 and CS0117

$
0
0

I am creating a website/blog with a register/login/logout feature. I am almost done, but having a hard time with the Identities on the .Net8. The scaffolding feature changed and there were no YT videos to reference.

My NavMenu.razor shows the following code:

@inject NavigationManager Navigation<div class="top-row container-fluid"><a class="navbar" href="">WebsiteProject</a><input type="checkbox" title="Navigation menu" class="navbar-toggler" data-bs-toggle="collapse" data-bs-target="#navbar" /></div><div class="nav-scrollable collapse navbar-collapse" id="navbar"><nav class=""><div class="nav-item px-3"><NavLink class="nav-link" href="" Match="NavLinkMatch.All">                Home</NavLink></div><div class="nav-item px-3"><NavLink class="nav-link" href="Blog">                Blog</NavLink></div></nav></div>@code {    private string? currentUrl;    protected override void OnInitialized()    {        currentUrl = NavigationManager.ToBaseRelativePath(NavigationManager.Url);        NavigationManager.LocationChanged += OnLocationChanged;    }    private void OnLocationChanged(object? sender, LocationChangedEventArgs e)    {        currentUrl = NavigationManager.ToBaseRelativePath(e.Location);        StateHasChanged();    }    public void Dispose()    {        NavigationManager.LocationChanged -= OnLocationChanged;    }}

The following are the error codes that I can't seem to get rid of:

ErrorCodes from VS 2022

I have searched YT, Google, and even AI to see if it can help me find a way to fix my code, but no answers were found. Hence, I would like someone to help me troubleshoot my code.


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>