我有一個如下問題: 我有一個頁面,我需要從後面的代碼動態地創建大量元素。它顯然取決於從數據庫傳遞的內容,但元素的數量可能會發生變化,這就是爲什麼我無法做到靜態。ASP.NET AJAX工具包CalendarExtender不工作C#
我在看什麼,就是:
我已經靜態創建PANEL:
<asp:Panel ID="pFullInfo_lStartDateStr" runat="server"></asp:Panel>
然後在後面的代碼,我創建其他控件,並將其添加到我的標籤。問題我有是,點擊後iEditStartDateCalendar應該出現的CalendarExtender不彈出:(我看不到我在做什麼錯在這裏?任何幫助嗎?!?!
// StartDate
Label lStartDateSite = new Label();
pFullInfo_lStartDateStr.Controls.Add(lStartDateSite);
Label lStartDate = new Label();
pFullInfo_lStartDateStr.Controls.Add(lStartDate);
ImageButton ibEditStartDate = new ImageButton();
ibEditStartDate.ID = "ibEditStartDate_" + this_site_id;
pFullInfo_lStartDateStr.Controls.Add(ibEditStartDate);
TextBox tbEditStartDate = new TextBox();
pFullInfo_lStartDateStr.Controls.Add(tbEditStartDate);
Image iEditStartDateCalendar = new Image();
iEditStartDateCalendar.ID = "iEditStartDateCalendar";
iEditStartDateCalendar.ImageUrl = "~/i/small/calendar.png";
iEditStartDateCalendar.ImageAlign = ImageAlign.AbsMiddle;
pFullInfo_lStartDateStr.Controls.Add(iEditStartDateCalendar);
CalendarExtender ceEditStartDate = new CalendarExtender();
ceEditStartDate.ID = "ceEditStartDate_" + this_site_id;
ceEditStartDate.PopupButtonID = iEditStartDateCalendar.UniqueID;
ceEditStartDate.TargetControlID = tbEditStartDate.UniqueID;
ceEditStartDate.PopupPosition = CalendarPosition.Right;
pFullInfo_lStartDateStr.Controls.Add(ceEditStartDate);