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

Datepicker taghelper

5 Answers 235 Views
Date/Time Pickers
This is a migrated thread and some comments may be shown as answers.
Christian Sandöy
Top achievements
Rank 2
Christian Sandöy asked on 12 Jul 2017, 11:16 AM

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

5 Answers, 1 is accepted

Sort by
0
Accepted
Viktor Tachev
Telerik team
answered on 17 Jul 2017, 08:14 AM
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.
0
Christian Sandöy
Top achievements
Rank 2
answered on 17 Jul 2017, 08:37 AM
It worked, thanks
0
Laurie
Top achievements
Rank 2
answered on 07 Mar 2019, 09:53 PM
Why is this not documented on, for example, this page: https://docs.telerik.com/aspnet-core/tag-helpers/editors/datepicker/overview
0
Viktor Tachev
Telerik team
answered on 12 Mar 2019, 11:35 AM
Hello Laurie,

Thank you for the feedback. I have added this to our backlog so additional information regarding the for attribute would be added to the documentation.


Regards,
Viktor Tachev
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Laurie
Top achievements
Rank 2
answered on 12 Mar 2019, 01:31 PM
Thanks, Viktor!
Tags
Date/Time Pickers
Asked by
Christian Sandöy
Top achievements
Rank 2
Answers by
Viktor Tachev
Telerik team
Christian Sandöy
Top achievements
Rank 2
Laurie
Top achievements
Rank 2
Share this question
or