New to Telerik UI for ASP.NET CoreStart a free 30-day trial

Button in Razor Pages

Razor Pages is an alternative to the MVC pattern that makes page-focused coding easier and more productive. This approach consists of a cshtml file and a cshtml.cs file (by design, the two files have the same name).

You can seamlessly integrate the Telerik UI Button for ASP.NET Core in Razor Pages applications.

This article describes how to configure the Button component in a Razor Pages scenario.

For the complete project, refer to the Button in Razor Pages example.

csthml
       
    @inject Microsoft.AspNetCore.Antiforgery.IAntiforgery Xsrf
	@Html.AntiForgeryToken()
	
	<form method="post">
		<input type="text" name="description">
		<br/>
		@(Html.Kendo().Button()
			.Name("primaryTextButton")
			.ThemeColor(ThemeColor.Primary)
			.HtmlAttributes(new { type = "submit" })
			.Events(e => e.Click("onClick"))
			.Content("Submit")
		)
	</form>
	

See Also

In this article
See Also
Not finding the help you need?
Contact Support