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

Assign Model value to declarative control property

1 Answer 120 Views
UI for ASP.NET AJAX in ASP.NET MVC
This is a migrated thread and some comments may be shown as answers.
Dallas Sehlhorst
Top achievements
Rank 1
Dallas Sehlhorst asked on 10 May 2009, 10:03 PM
Hey guys,

I'm stuck on something that should be simple: how can I bind a Model value to a Telerik control's property.  More specificly, how do I set the SelectedDate property of a RadDatePicker?  I tried the following, but it's giving me a "server tag is not well formed error."

<telerik:RadDatePicker ID="radInstallDate" SelectedDate='<%= Model.InstallDate %>' runat="server" Width="150px" SharedCalendarID="sharedCalendar"
</telerik:RadDatePicker> 

Thanks for the help!

-Dallas

1 Answer, 1 is accepted

Sort by
0
Svetlina Anati
Telerik team
answered on 11 May 2009, 08:53 AM
Hello Dallas,

In order to bind the date picker control correctly you should use the following syntax:  SelectedDate='<%# Eval('Model.InstallDate') %>'. In case this does not work, please provide more explanations of the exact scenario and the data source or best - open a new support ticket and send us a sample, fully runnable reproduction demo along with detailed explanations of the desired result.


Best wishes,
Svetlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
UI for ASP.NET AJAX in ASP.NET MVC
Asked by
Dallas Sehlhorst
Top achievements
Rank 1
Answers by
Svetlina Anati
Telerik team
Share this question
or