繁体   English   中英

如何将Kendo Textbox控件绑定到其数据?

[英]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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM