![](/img/trans.png)
[英]How do I bind a XAML TextBox to either another TextBox's input or its own input, and then save the input to the data object in MVVM?
[英]How do I bind the Kendo Textbox control to its data?
我使用了一些Kendo Telerik控件设计了一个视图。 我不知道如何将他们的控件绑定到数据。
这个生成的脚手架方法有效:
@Html.EditorFor(model => model.surName, new { htmlAttributes = new { @class = "form-control" } })
如何绑定Kendo文本框?
@(Html.Kendo().TextBox()
.Name("fName")
.HtmlAttributes(new { placeholder = "First Name", required = "required", validationmessage="Enter First Name" })
)
使用Kendo().TextBoxFor
方法:
@(Html.Kendo().TextBoxFor(model => model.FirstName)
.Name("fName")
.HtmlAttributes(new { placeholder = "First Name", required = "required", validationmessage="Enter First Name" })
)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.