473,413 Members | 1,700 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,413 software developers and data experts.

Accordion

Hello
I want to create Accordion (Ajax Control Tool Kit).
My Code is as follows
Expand|Select|Wrap|Line Numbers
  1. protected void Page_Load(object sender, EventArgs e)
  2.     {
  3.                try
  4.             {
  5.         Accordion aCC = new Accordion();
  6.         AccordionPane aPane = new AccordionPane();
  7.         aPane.Width=300;
  8.         aPane.HeaderContainer.Controls.Add(new LiteralControl("Dyanamic Accordiaon"));
  9.         aPane.ContentContainer.Controls.Add(new LiteralControl("jdfh"));
  10.         aCC.Panes.Add(aPane);
  11.         AccordionPane aPane1 = new AccordionPane();
  12.         aPane1.Width = 300;
  13.         aPane1.HeaderContainer.Controls.Add(new LiteralControl("Collapse"));
  14.         aPane1.ContentContainer.Controls.Add(new LiteralControl("jdfgdth"));
  15.         aCC.Panes.Add(aPane1);
  16.         aCC.Visible = true;
  17.             }
  18.             catch(Exception e1)
  19.             {
  20.                 Response.Write(e1);
  21.  
  22.             }
  23.  
  24.  
  25.     }
But Accordion is not visible and also no errors
when i created Accordion in designing & iam adding AccordionPanes to that Accordion then it is working quite good.
Please any one solve it
Jul 10 '07 #1
7 6175
Frinavale
9,735 Expert Mod 8TB
Hello
I want to create Accordion (Ajax Control Tool Kit).
My Code is as follows
Expand|Select|Wrap|Line Numbers
  1. protected void Page_Load(object sender, EventArgs e)
  2.     {
  3.                try
  4.             {
  5.         Accordion aCC = new Accordion();
  6.         AccordionPane aPane = new AccordionPane();
  7.         aPane.Width=300;
  8.         aPane.HeaderContainer.Controls.Add(new LiteralControl("Dyanamic Accordiaon"));
  9.         aPane.ContentContainer.Controls.Add(new LiteralControl("jdfh"));
  10.         aCC.Panes.Add(aPane);
  11.         AccordionPane aPane1 = new AccordionPane();
  12.         aPane1.Width = 300;
  13.         aPane1.HeaderContainer.Controls.Add(new LiteralControl("Collapse"));
  14.         aPane1.ContentContainer.Controls.Add(new LiteralControl("jdfgdth"));
  15.         aCC.Panes.Add(aPane1);
  16.         aCC.Visible = true;
  17.             }
  18.             catch(Exception e1)
  19.             {
  20.                 Response.Write(e1);
  21.  
  22.             }
  23.  
  24.  
  25.     }
But Accordion is not visible and also no errors
when i created Accordion in designing & iam adding AccordionPanes to that Accordion then it is working quite good.
Please any one solve it
Is there any reason why you can't create the Accordian in design and then fill it in the Server side code?

-Frinny
Jul 10 '07 #2
I want to create Accordion dynamically.
Iam inserting it in gridview template column
If there are more records in the gridview then it is taking much time to load
Thanks for your reply
Jul 11 '07 #3
Frinavale
9,735 Expert Mod 8TB
I want to create Accordion dynamically.
Iam inserting it in gridview template column
If there are more records in the gridview then it is taking much time to load
Thanks for your reply
I think you're going to have to register the control in the page for it to show up.
Have you used Controls.Add(myAccordion) in your code to add your dynamically created accordion control to your page?

-Frinny
Jul 11 '07 #4
[quote=Frinavale]I think you're going to have to register the control in the page for it to show up.
Have you used Controls.Add(myAccordion) in your code to add your dynamically created accordion control to your page?

-Frinny[/QUO

Hello
I tried it in 2 ways
1st way

I created 1 panel in design
and i wrote code as
Panel1.Controls.Add(aCC);

2nd way
Scriptmanger1.Controls.Add(aCC);

But in both the cases
the unHandled Exception while running

is as follows

System.InvalidOperationException was unhandled by user code
Message="The TargetControlID of '_AccordionExtender' is not valid. The value cannot be null or empty."
Source="System.Web.Extensions"
StackTrace:
at System.Web.UI.ExtenderControl.RegisterWithScriptMa nager()
at System.Web.UI.ExtenderControl.OnPreRender(EventArg s e)
at AjaxControlToolkit.ExtenderControlBase.OnPreRender (EventArgs e)
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Jul 12 '07 #5
Set the aCC.ID! It will work fine!

[quote=srilakshmim]
I think you're going to have to register the control in the page for it to show up.
Have you used Controls.Add(myAccordion) in your code to add your dynamically created accordion control to your page?

-Frinny[/QUO

Hello
I tried it in 2 ways
1st way

I created 1 panel in design
and i wrote code as
Panel1.Controls.Add(aCC);

2nd way
Scriptmanger1.Controls.Add(aCC);

But in both the cases
the unHandled Exception while running

is as follows

System.InvalidOperationException was unhandled by user code
Message="The TargetControlID of '_AccordionExtender' is not valid. The value cannot be null or empty."
Source="System.Web.Extensions"
StackTrace:
at System.Web.UI.ExtenderControl.RegisterWithScriptMa nager()
at System.Web.UI.ExtenderControl.OnPreRender(EventArg s e)
at AjaxControlToolkit.ExtenderControlBase.OnPreRender (EventArgs e)
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Jul 30 '07 #6
axxon
6
[quote=robertonline]Set the aCC.ID! It will work fine!

Hi i think ACC is the ID and I am running into the same problem!!! can u show me the actual code that works?
Thnx
Aug 4 '07 #7
Set the aCC.ID! It will work fine!



Hi i think ACC is the ID and I am running into the same problem!!! can u show me the actual code that works?
Thnx

Sorry for the ugly code, but this post helped me the last way - i had the same problem:
Expand|Select|Wrap|Line Numbers
  1.       ScriptManager manager = new ScriptManager();
  2.       form1.Controls.Add(manager);
  3.  
  4.       Label label_a_head = new Label();
  5.       label_a_head.Text = "Label A Head";
  6.       Label label_a_content = new Label();
  7.       label_a_content.Text = "Label A Content";
  8.  
  9.       Label label_b_head = new Label();
  10.       label_b_head.Text = "Label B Head";
  11.       Label label_b_content = new Label();
  12.       label_b_content.Text = "Label B Content";
  13.  
  14.       Accordion ac = new Accordion();
  15.       ac.ID = "AccordionID";
  16.  
  17.       AccordionPane ap1 = new AccordionPane();
  18.       ap1.HeaderContainer.Controls.Add(label_a_head);
  19.       ap1.ContentContainer.Controls.Add(label_a_content);
  20.       ac.Panes.Add(ap1);
  21.  
  22.       AccordionPane ap2 = new AccordionPane();
  23.       ap2.HeaderContainer.Controls.Add(label_b_head);
  24.       ap2.ContentContainer.Controls.Add(label_b_content);
  25.       ac.Panes.Add(ap2);
  26.  
  27.       form1.Controls.Add(ac);
  28.  
And Smile...Have a nice day :-)
Aug 31 '07 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: srilakshmim | last post by:
Hello I want to create Accordion (Ajax Control Tool Kit)dynamically. My Code is as follows Code: ( cpp ) protected void Page_Load(object sender, EventArgs e) { try ...
1
by: anjali.lourda | last post by:
Hi, We are trying to use the accordion control from ajaxcontroltoolkit by databinding to an sqldatasource. The accordion binds to the datasource perfectly. However, We are not able to access the...
0
by: axxon | last post by:
hi, I am having a huge problem here! the scenario is i am trying to create dynamic accordion Panes to a accordion control inside a tab panel in a content page. It works just fine in a regular...
0
by: rcon | last post by:
I'm creating a user control to prompt for crystal reports parameters. The individual controls work fine, and the over all control works fine too. However, I'm not really that experienced in the...
2
by: LayneMitch via WebmasterKB.com | last post by:
Greetings. I'm reading this book that is teaching me the more appropriate way of assigning functions. It has an 'accordian' example that when you click on a link, it expands into other options...
8
by: Tomasz J | last post by:
Hello developers, After migrating my web project application (using the old model) to .Net Framework 3.5 and Ajax Control Toolkit release 20820 the Accordion control no longer works correctly....
1
by: petersonus115 | last post by:
Hi my name is jewel.. i am having a problem with accordion pane.. I am using newest version of ajax control tool kit.. i have two text box and one button in my accordion pane... I want to execute...
6
by: Andy B | last post by:
I am trying to use an accordion control from the ajax control toolkit for ..net3.5 sp1. When I put a link in one of the accordion pannel headerTemplates to open and close the content, I always get...
8
by: quipo | last post by:
Hi, im using an accordion script but it doesnt work if i use it with ajax. example: <div id="accordion"> <dl class="accordion" id="slider"> <dt>click here for the 1st pane</dt> ...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.