Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Displaying Asp.net AJAX Calendar Extender Two Ways

Is there a way to set up the calendar extender so that the calendar displays when the text box recieves focus AND when the when the element with the "PopupButtonID" is clicked? With my current settings it seems to be one or the other.

like image 866
Anurag Avatar asked Dec 28 '22 17:12

Anurag


1 Answers

It's a bit of an ugly way to do it, but you can do this if you're prepared to use two extenders.

<asp:TextBox runat="server" ID="DateTextBox" />
<asp:ImageButton runat="server" ID="CalendarImageButton" ImageUrl="~/date_16x16.gif" />
<ajaxtoolkit:CalendarExtender runat="server" id="Extender1" TargetControlID="DateTextBox"/>
<ajaxtoolkit:CalendarExtender runat="server" ID="Extender2" TargetControlID="DateTextBox" PopupButtonID="CalendarImageButton" />

This way the calendar will appear whether you focus on the textbox or click the imagebutton.

like image 143
PhilPursglove Avatar answered Jan 12 '23 00:01

PhilPursglove