473,387 Members | 1,318 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,387 software developers and data experts.

ASP.NET AJAX Accordion UpdatePanel

149 100+
Hi,

I am new to implementing Asynchronous javascript in asp.net (or any framework) and have come across a problem.

In a user control I have an accordion with a nested updatepanel, the trigger is a link button in the header. I have read several posts that suggest I need to add the ControlID in the codebehind, so I have and I don't get any errors, but also there's nothing loading into the updatepanel.

Here's the code;

Codebehind:

Expand|Select|Wrap|Line Numbers
  1.  protected void Page_Init(object sender, EventArgs e)
  2.     {
  3.         LinkButton UserLink = Accordion1.FindControl("UserLink") as LinkButton;
  4.         ScriptManager.GetCurrent(this.Page).RegisterAsyncPostBackControl(UserLink);
  5.         //Creates a new async trigger
  6.         AsyncPostBackTrigger trigger = new AsyncPostBackTrigger();
  7.  
  8.         //Sets the control that will trigger a post-back on the UpdatePanel
  9.         trigger.ControlID = "UserLink";
  10.  
  11.         //Sets the event name of the control
  12.         trigger.EventName = "Click";
  13.  
  14.         //Adds the trigger to the UpdatePanels' triggers collection
  15.         UpdatePanelUser.Triggers.Add(trigger);
  16.     }
  17.     protected void Page_Load(object sender, EventArgs e)
  18.     {
  19.  
  20.     }
  21.     protected void UserLink_Click(object sender, EventArgs e)
  22.     {
  23.         String userPanelPath = "~/CMS/_admin/_components/CMS_controls/admin_controls/UserPanel.ascx";
  24.         Control userPanel = Page.LoadControl(userPanelPath);
  25.         PanelUser.Controls.Add(userPanel);
  26.     }
apsx page:

Expand|Select|Wrap|Line Numbers
  1. <ajaxToolkit:Accordion ID="Accordion1" runat="server" HeaderSelectedCssClass="AdminPanelHeaderSelected" RequireOpenedPane="false" SuppressHeaderPostbacks="true" SelectedIndex="0" HeaderCssClass="AdminPanelHeader" ContentCssClass="AdminPanelContent" FadeTransitions="true" FramesPerSecond="40" TransitionDuration="250" AutoSize="none">
  2.             <Panes>
  3.                 <ajaxToolkit:AccordionPane runat="server" ID="Home" >
  4.                     <Header>
  5.                         <a href="" onclick="return false;">Home</a>
  6.                     </Header>
  7.                     <Content>
  8.                     </Content>
  9.                 </ajaxToolkit:AccordionPane>
  10.                 <ajaxToolkit:AccordionPane runat="server" ID="UserPanel">
  11.                     <Header>
  12.                          <asp:LinkButton ID="UserLink" runat="server">User panel</asp:LinkButton>
  13.                     </Header>
  14.                     <Content>
  15.                         <asp:UpdatePanel ID="UpdatePanelUser" runat="server" UpdateMode="Conditional">
  16.                             <ContentTemplate>
  17.                                 <asp:Panel ID="PanelUser" runat="server">
  18.                                 </asp:Panel>
  19.                             </ContentTemplate>
  20.  
  21.                         </asp:UpdatePanel>
  22.                     </Content>
  23.                 </ajaxToolkit:AccordionPane>
  24.                 <ajaxToolkit:AccordionPane runat="server" ID="STATS">
  25.                 <Header>
  26.                         <a href="" onclick="return false;">Statistics</a>
  27.                     </Header>
  28.                     <Content>
  29.                     </Content>
  30.                 </ajaxToolkit:AccordionPane>
  31.                 <ajaxToolkit:AccordionPane runat="server" ID="GroupEmails">
  32.                 <Header>
  33.                         <a href="" onclick="return false;">Group Email</a>
  34.                     </Header>
  35.                     <Content>
  36.                     </Content>
  37.                 </ajaxToolkit:AccordionPane>
  38.                 <ajaxToolkit:AccordionPane runat="server" ID="Errors">
  39.                 <Header>
  40.                         <a href="" onclick="return false;">Error reporting</a>
  41.                     </Header>
  42.                     <Content>
  43.                     </Content>
  44.                 </ajaxToolkit:AccordionPane>
  45.             </Panes>
  46.             </ajaxToolkit:Accordion>
Any help would be appreciated.
Jul 21 '07 #1
0 6839

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

Similar topics

4
by: =?Utf-8?B?R2VyaGFyZA==?= | last post by:
I am just stating to use ajax, and have a perfect place to use the accordion control. I have it working fine, but need to have a normal asp button in one of the panes that fires an onclick event...
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...
7
by: =?Utf-8?B?V2FubmFiZQ==?= | last post by:
We are looking at Ajaxing our existing web application. Question is...Should we Ajax any and everything we can, or not? One example...if a page posts back to itself, is that a good candidate for...
4
by: ameshkin | last post by:
Hi Everybody, I'm just now learning javascript and I'm using mootools. What I want to do is to dynamically load a php page into accordian panel 2, depending on which radio button is selected in...
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: E11esar | last post by:
Hi there. I have created an asp.net page with C# and have added two tabs using the respective AJAX control. I am trying to add a table within an AJAX Accordion control in the second tab but I am...
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> ...
3
by: stoogots2 | last post by:
I'm wondering why I can't find the updatepanel control in my codebehind file Page_Load event. I have several gridviews, each in their own accordion control/pane, all inside an updatepanel (which I...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
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
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...

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.