Blazor server adding component content to another component, instead to reload and open a new page

I have a problem with my Blazor Server. I have two components in the "Page" folder. The first one is "TimeLine.razor" and the second one is "OrderSetup". From the "TimeLine" component I want to open a new page "OrderSetup". For this purpose I added @page "/ordersetup" directive to my "OrderSetup" component. Then inside the "TimeLine" I added a link tag with "ordersetup". And when I click over the button, the content of the "OrderSetup" page is opening(adding) inside the "TimeLine" content. I do not know Why is happening this, because I expected the "TimeLine" page to reload and to open a new page - "OrderSetup". So instead to reload and open the "OrderSetup" page, Blazor Server just adding the content of "OrderSetup" to the "TimeLine" content.


1 Reply

YA YuvanShankar Arunagiri Syncfusion Team May 17, 2022 08:44 AM UTC

Hi Dobri,


We have checked your reported query and prepared the sample based on your requirement.

Please refer the below code snippet. Use NavigationManager for navigate to other pages in the button click event.


[Index.razor]:


@using Syncfusion.Blazor.Buttons

@inject NavigationManager _navigationManager

 

<SfButton CssClass="e-link" @onclick="OnClick">Link</SfButton>

 

@code{

    private void OnClick()

    {

        _navigationManager.NavigateTo("/Counter");

    }

}


For your convenience, we have attached the sample.


Please get back to us if you need further assistance on this.


Regards,

Yuvan Shankar A


Attachment: BlazorApp3_df12e1a1.zip

Loader.
Up arrow icon