Friday, June 19, 2009

Use Multiple Controls to open ajaxToolkit:CalendarExtender control..

Problem Area: Check out the image above, its showing a calendar control which is being displayed on click of Image button adjacent to text box. Now if you want to display calendar on click of both text box as well as image button then there will be a problem. You can set one control at a time in PopupButtonID property. That means in above scenario either you can use textbox to open this calendar OR you can use image to open calender. Now there is small trick to perform this. Yes, you can use a simple trick and make it open on click of both textbox and image.

Solution: Set PopupButtonID property of the control with multiple control ids as shown in following example.


< ajaxtoolkit:calendarextender id="CalendarExtenderStartDate" runat="server" targetcontrolid="StartDateText" popupbuttonid="StartDateText DateStart">< id="CalendarExtenderStartDate" runat="server" targetcontrolid="StartDateText" popupbuttonid="StartDateText DateStart">


Use popupbuttonid property and specify various control Ids in it.(separated by space)

Thanks....

No comments:

Post a Comment