Venkat
Venkat

Reputation: 2156

redirecting to a different page in blazor

<MudButton ButtonType="ButtonType.Button" OnClick="" Variant="Variant.Filled" Color="Color.Primary" Class="ml-auto">Cancel</MudButton>

Pressing this button must navigate to another page. How do I do this in blazor? In javascript we use DOM object to set the href. Not sure how we do in blazor

Upvotes: 5

Views: 11495

Answers (1)

Lex
Lex

Reputation: 7194

Inject NavigationManager and then use NavigationManager.NavigateTo(<your URL>);.

Upvotes: 6

Related Questions