c# - Dynamically Creating AJAX Accordian Controls -


I'm trying to create Accordian Controlls dynamically on page load, the code is intelligent what I've done so far Is:

  // Dynamic Excellent control Ajax control toolkit. Accordion information = new Ajax controlToolkit ACCDon (); AjaxControlToolkit.AccordionPane infoPane = New AjaxControlToolkit.AccordionPane (); Info.ID = hostelId; Info.FadeTransitions = True; Info.FramesPerSecond = 10; Info.TransitionDuration = 500; Textual header content = new literal (); HeaderContent.ID = hostelId + "_Header"; HeaderContent.Text = hostelName + "more info"; Literary content = new verbatim (); Content.ID = hostlid + "_Content"; Content.Text = Hostname name + "Boom"; InfoPane.HeaderContainer.Controls.Add (headerContent); InfoPane.ContentContainer.Controls.Add (content); Info.Panes.Add (infoPane); Cell3.Controls.Add (info);  

When I run the page, Accordian displays content for control, but its just text and not the actual accordian simply thinking that someone can tell me in the right direction.

I'm guessing that you also have to add Accordion to your page On ScriptManager .

  scriptManager.Controls.Add (info);  

In addition, have you tried to add control to other event handlers? See that Init is an event on which you should add dynamically control, at least accordingly. (I do not remember where I have done it in my web applications, but Init would be correct.)

Hope that helps.


Comments