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

Blazor @page "/search" is not found

$
0
0

I'm just starting to use Blazor. I'm using Net 8 In Visual Studio 2022

This is my App.razor file

<Router AppAssembly="@typeof(App).Assembly"><Found Context="routeData"><RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" /><FocusOnNavigate RouteData="@routeData" Selector="h1" /></Found><NotFound><PageTitle>Not found</PageTitle><LayoutView Layout="@typeof(MainLayout)"><p role="alert">Sorry, there's nothing at this address.</p></LayoutView></NotFound></Router>

The directory structure is the default

--Features        -->Home                --> HomePage.razor                --> TestPage.razor

My HomePage is the main page.

@page "/"

My TestPage.razor has this

    @page "/Test"<PageTitle>TEST</PageTitle><h3>TEST results</h3>

When I run the App. its open in HomePage it the URL

https://localhost:7258/

But when I want to redirect to TestPage I change the URL to

 https://localhost:7258/Test

But it appears the message

Sorry, there's nothing at this address.

I checked .csproj file as says here

Adding

<ItemGroup><Folder Include="Features\Home\" /></ItemGroup>

But nothing has changed..

What I am missing?

Thanks


Viewing all articles
Browse latest Browse all 4839

Trending Articles



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