This is a migrated thread and some comments may be shown as answers.

How to set data-bind in ASP MVC CSHTML way?

1 Answer 88 Views
Button
This is a migrated thread and some comments may be shown as answers.
Tiago
Top achievements
Rank 1
Tiago asked on 24 May 2015, 12:02 PM

Hi all,

How to represent the following in ASP MVC cshtml way - Html.Kendo().Button :

<button data-bind="click: enableInput, enabled: isNameEnabled">Enable</button>

Assuming kendo.observable has been implemented.

Thanks,

Tiago

1 Answer, 1 is accepted

Sort by
1
Accepted
Alexander Popov
Telerik team
answered on 26 May 2015, 08:52 AM
Hello Tiago,

This could be achieved using the HtmlAttributes method. For example: 
@(Html.Kendo().Button()
    .Name("myButton")   
    .Content("Enable")
    .HtmlAttributes(new {data_bind = "click: enableInput, enabled: isNameEnabled" })
)

Regards,
Alexander Popov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Button
Asked by
Tiago
Top achievements
Rank 1
Answers by
Alexander Popov
Telerik team
Share this question
or