Datepicker taghelper

3 posts, 1 answers
  1. Christian Sandöy
    Christian Sandöy avatar
    17 posts
    Member since:
    Aug 2005

    Posted 12 Jul Link to this post

    Im trying to do this as a taghelper

    @(Html.Kendo().DatePickerFor(m => m.Pressefoto).Deferred())

    With this

    <kendo-datepicker name="Pressefoto" asp-for="Pressefoto" deferred="true" />

    asp-for  does not work, no value from model

    and I need to specify name or I get a runtime error

  2. Answer
    Viktor Tachev
    Admin
    Viktor Tachev avatar
    1766 posts

    Posted 17 Jul Link to this post

    Hi Christian,

    In order to bind the DatePicker tag helper to a field in the Model you should use the for attribute. The code would look similar to the following. 


    <kendo-datepicker name="Pressefoto" for="Pressefoto" deferred="true" />


    Give the approach a try and let me know how it works for you.


    Regards,
    Viktor Tachev
    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. Christian Sandöy
    Christian Sandöy avatar
    17 posts
    Member since:
    Aug 2005

    Posted 17 Jul Link to this post

    It worked, thanks
Back to Top