Reputation: 2614
I'd like to use a calendar control to edit a date in my mvc application. The ajaxtoolkit's calendarextender seems like a good choice.
However, when I reference the name given in markup, the application reports that the control cannot be found.
How can I reference the textbox created with mvc html-extensions?
Thanks,
Anders, Denmark
Below my first shot which produces an error - targetcontrolid not valid.
<%= Html.TextBox("DateOfEarliestEmail", Model.DateOfEarliestEmail)%>
<ajaxToolKit:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="DateOfEarliestEmail" Format="yyyy-MM-dd" PopupButtonID="Image1"/>
<%= Html.ValidationMessage("DateOfEarliestEmail", "*")%>
Upvotes: 1
Views: 3998
Reputation: 3957
That can be a messy choice. If I were you, I would use a jQuery plug in.
But, here is a walkthrough (might be a bit outdated and based on an asp.net mvc RC) on how to use asp.net mvc w/ the ajaxcontrol toolkit:
Also see: ASP.NET MVC & Ajax Control Toolkit
Upvotes: 1