开发者

Can I use my beloved Calendar Extender in MVC?

开发者 https://www.devze.com 2022-12-20 18:18 出处:网络
I love the calendar extender, but I a开发者_开发知识库m 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?

I love the calendar extender, but I a开发者_开发知识库m 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>


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.


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


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.


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!!!

0

精彩评论

暂无评论...
验证码 换一张
取 消