File tree Expand file tree Collapse file tree 1 file changed +28
-9
lines changed Expand file tree Collapse file tree 1 file changed +28
-9
lines changed Original file line number Diff line number Diff line change @@ -35,15 +35,34 @@ You can style anchors to look like Telerik buttons through the `k-button` CSS cl
35
35
36
36
> caption Open a new browser window from a button
37
37
38
- ![ make links look like buttons] ( images/links-like-buttons.png )
39
-
40
38
```` CSHTML
41
- <a class="k-button" href="/fetchdata">Fetch Data</a>
42
- <br /><br />
43
- <NavLink class="k-button" href="/counter">Counter</NavLink>
44
- <br /><br />
45
- <a class="k-button" target="_blank" href="https://www.telerik.com">telerik.com in new window</a>
46
- <br /><br />
47
- <NavLink class="k-button" target="_blank" href="https://www.google.com">Google in new window</NavLink>
39
+ @inject NavigationManager NavManager
40
+ @inject IJSRuntime JS
41
+
42
+ <TelerikButton OnClick="@OnButtonClick">Navigate to telerik.com in the same window</TelerikButton>
43
+
44
+ <br />
45
+
46
+ <TelerikButton OnClick="@OnButtonClickAsync">Navigate to telerik.com in a new window using JSInterop</TelerikButton>
47
+
48
+ <br />
49
+
50
+ <NavLink class="k-button k-button-solid k-rounded-md k-button-md k-button-solid-base"
51
+ target="_blank"
52
+ href="https://www.google.com">
53
+ Google in new window
54
+ </NavLink>
55
+
56
+ @code{
57
+ private void OnButtonClick()
58
+ {
59
+ NavManager.NavigateTo("https://www.telerik.com");
60
+ }
61
+
62
+ private async Task OnButtonClickAsync()
63
+ {
64
+ await JS.InvokeVoidAsync("open", "https://www.telerik.com", "_blank");
65
+ }
66
+ }
48
67
````
49
68
You can’t perform that action at this time.
0 commit comments