Calendar Extender in Ajax Toolkit does not work as expected on ASP.NET content page

I am implementing a project in asp.net where I am using the Ajax Toolkit Calendar Extender.
The calendar extender is used on the content page. But the calender does not show it correctly. The calendar is out of place from the "text box" that the calendar expander belongs to.

+3


source to share


4 answers


You just write the style for the calendar expander in a separate CSS class,

Then assign it to the calendar expander.



<asp:CalendarExtender   ID="CalendarExtender1"  runat="server"  TargetControlID="TextBox1"    CssClass="CalendarCSS"/>  

      

+3


source


Try it.



<asp:TextBox   ID="TextBox1"  runat="server"/>

<asp:CalendarExtender   ID="CalendarExtender1"  runat="server"  TargetControlID="TextBox1"    CssClass="CalendarCSS"/>  

      

+2


source


Make sure the TargetControlID of the calendar extender is equal to the TextBoxID and then you've enabled the PopupPosition property .

For example:

<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<cc1:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="TextBox1" PopupPosition="Right"></cc1:CalendarExtender>

      

Hope this helps you.

+1


source


The best way to solve this problem is to simply add an ajax assembly to your page at the top:

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="ajaxToolkit" %>

      

And don't forget to add the tagprefix in the calendar extender as "ajaxToolkit".

ex:

<ajaxToolkit:CalendarExtender ID="txtPostingDate_CalendarExtender"
runat="server" Enabled="True" TargetControlID="txtPostingDate"
Format="MM/dd/yyyy">
                                            </ajaxToolkit:CalendarExtender>

      

0


source







All Articles