How to associate a Kendo Textbox control with its data?

I designed the view using some of the Kendo Telerik controls. I'm not sure how to bind their controls to data.

This generated construction method works:

@Html.EditorFor(model => model.surName, new { htmlAttributes = new { @class = "form-control" } }) 

How to link a Kendo text box?

 @(Html.Kendo().TextBox() .Name("fName") .HtmlAttributes(new { placeholder = "First Name", required = "required", validationmessage="Enter First Name" }) ) 
+6
source share
1 answer

Use the Kendo().TextBoxFor :

 @(Html.Kendo().TextBoxFor(model => model.FirstName) .Name("fName") .HtmlAttributes(new { placeholder = "First Name", required = "required", validationmessage="Enter First Name" }) ) 
+8
source

Source: https://habr.com/ru/post/989262/


All Articles