Skip to content

Blazor-server-side Multi routing such as in mvc #37485

@Alerinos

Description

@Alerinos

I have two sides

@page "/{article?}"

<h2>@article</h2>

@code {
    [Parameter]
    public string article { get; set; } = "";

    protected override async Task OnInitializedAsync() 
    {
        if(article != "testArticle")
        {
            // return NOTFOUND
        }
    }

}
@page "/{game?}"

<h2>@game</h2>

@code {
    [Parameter]
    public string game { get; set; } = "";

    protected override async Task OnInitializedAsync() 
    {
        if(game != "testGame")
        {
            // NOTFOUND
        }
    }

}

I would like many sites to be able to run under one domain like in mvc
example:

domain.com/good-news
dmoain.com/best-game
domain.com/good-forwarding
domain.com/testGame
domain.com/testArticle

in mvc it was enough to give return NotFound();

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions