2
我想在網頁加載創建手風琴Controlls Dynammically,代碼明智的,這是我到目前爲止有:動態創建AJAX手風琴控制
// Create dynamic acordian control
AjaxControlToolkit.Accordion info = new AjaxControlToolkit.Accordion();
AjaxControlToolkit.AccordionPane infoPane = new AjaxControlToolkit.AccordionPane();
info.ID = hostelId;
info.FadeTransitions = true;
info.FramesPerSecond = 10;
info.TransitionDuration = 500;
Literal headerContent = new Literal();
headerContent.ID = hostelId + "_Header";
headerContent.Text = hostelName + " More Info ";
Literal content = new Literal();
content.ID = hostelId + "_Content";
content.Text = hostelName + " BOOM ";
infoPane.HeaderContainer.Controls.Add(headerContent);
infoPane.ContentContainer.Controls.Add(content);
info.Panes.Add(infoPane);
cell3.Controls.Add(info);
當我運行頁面時,contente的手風琴控制顯示,但它只是文字,而不是實際的手風琴。只是想知道是否有人能指引我正確的方向。
感謝隊友,工作完美。它在Page_Load中運行良好,我也忘了連接我的CSS,但之後它的運行非常好! – bExplosion 2009-05-04 12:02:01