Search code examples
asp.netajaxcalendarextender

Ajax Calendarextender location with invisible textbox


I have a div and inside it I have a TextBox set to display:none, a CalendarExtender connected to it and a Button, next to the TextBox, that displays the calendar. When I click the button the calendar appears on the top left corner of the form. Is there any way to make it appear next to the button, where the textbox is located?


Solution

  • I fixed it with position:absolute; visibility: hidden; instead of display:none;.

    <asp:TextBox ID="t1" runat="server" Style="position:absolute; visibility: hidden" />
    <asp:Button ID="b1" runat="server" Text="Button" />
    <asp:CalendarExtender ID="c1" runat="server" TargetControlID="t1"
            PopupButtonID="b1"/>