views:

141

answers:

4

I love the calendar extender, but I am unable to use it in my MVC app. How do I connect the calendar extender to a textbox in MVC... or add the extender at all for that matter?

Old Way...

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
...
<asp:TextBox ID="txtDate1" runat="server" ValidationGroup="DateCheck">
</asp:TextBox>
...
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
...
<cc1:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txtDate1">
</cc1:CalendarExtender>
A: 

Why not use the JQuery UI datepicker? See JQuery UI DatePicker

PieterG
Preference thing, I think the CalendarExtender looks better. Not just css.
Yuriy Faktorovich
+2  A: 

Yes you can - if you use the Microsoft Ajax libraries. Link here. Calandar code here.

If you go to Stephen Walthers bolg - here I'm sure there's an example of using the server side controls if memory serves me correctly.

Simon G
A: 

Hey,

You have to setup your view like a web form, or use a web form within the MVC application, as it requires a form with runat server and a scriptmanager on the view page.

Brian
A: 

I found the solution. A pretty helpful step by step link that gave me EXACTLY what I want...CodeSprouts.com helped me out alot. Thanks for the directions!!!