This is a migrated thread and some comments may be shown as answers.

Hyperlinkbutton in blazor

1 Answer 3729 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Anju
Top achievements
Rank 2
Veteran
Anju asked on 02 Dec 2020, 10:26 AM
Do we have a replacement for Hyperlinkbutton in Blazor?
 

1 Answer, 1 is accepted

Sort by
0
Svetoslav Dimitrov
Telerik team
answered on 03 Dec 2020, 02:18 PM

Hello Anju,

If you are referring to the <a> tag with the href attribute you could use the NavLink from Microsoft. Alternatively, you could use our TelerikButton together with the NavigationManager to navigate to a page. The difference between the two is that the NavLink renders as <a href="google.com"></a>, whereas our renders as a <button>. This means that when you click Control + Click on the NavLink it would open the page in a new tab, whereas if you click on our button it would open the page in the same tab. Below, I have prepared a short example of both so you could compare their behavior and decide which one is more appropriate for your application.

@inject NavigationManager Navigation

<NavLink href="https://www.google.bg/">Google link</NavLink>

<br />

<TelerikButton OnClick="@( _ => Navigation.NavigateTo("https://www.google.bg/"))">Navigation to Google</TelerikButton>

Regards,
Svetoslav Dimitrov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
General Discussions
Asked by
Anju
Top achievements
Rank 2
Veteran
Answers by
Svetoslav Dimitrov
Telerik team
Share this question
or