Use button to open a page

Hi,

I am new with SyncFusion button,

Can I use SfButton to open a page?


Say I have a button below.

<SfButton  CssClass="e-primary">

 </SfButton>


I want to open  "/Grids/ProductListing" by clicking on the button?


Please provide some example


Thank 


Sao







1 Reply

YA YuvanShankar Arunagiri Syncfusion Team August 22, 2022 07:46 AM UTC

Hi Sao,


We have checked your reported query and prepared the sample based on your requirement. Please refer the below code snippet.


@using Syncfusion.Blazor.Buttons

@inject NavigationManager UriHelper

 

<h3>Naviagte to another page Programatically</h3>

<SfButton CssClass="e-primary" @onclick="Navigate">Click</SfButton>

 

 

@code {

    private void Navigate()

    {

        UriHelper.NavigateTo("/Grids/ProductListing");

    }

}


Could you please check the above code and get back to us, if you need any further assistance on this. 


Regards,

YuvanShankar A


Loader.
Up arrow icon