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

2 posts, 1 answers
  1. Tiago
    Tiago avatar
    2 posts
    Member since:
    May 2015

    Posted 24 May 2015 Link to this post

    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

  2. Answer
    Alexander Popov
    Admin
    Alexander Popov avatar
    1416 posts

    Posted 26 May 2015 Link to this post

    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!
     
  3. Kendo UI is VS 2017 Ready
Back to Top