Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8788857
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T22:14:31+00:00 2026-06-13T22:14:31+00:00

in ASP.NET 4 Website I need to fire a server side C# function when

  • 0

in ASP.NET 4 Website

I need to fire a server side C# function when an ajax accordion header is clicked, passing the header data value to the function. The accordion is filled from a database. How do I create the event to call the C# function?

<ajaxToolkit:Accordion ID="acc1" runat="server" Width="300px" 
     HeaderCssClass="accHeader" ContentCssClass="accContent" CssClass="accMain"
     FadeTransitions="true" SuppressHeaderPostbacks="false" TransitionDuration="250" RequireOpenedPane="false"
     HeaderSelectedCssClass="accSelHeader" FramesPerSecond="40">
        <HeaderTemplate><b><%#DataBinder.Eval(Container.DataItem, "CompanyName") %></b></HeaderTemplate>
        <ContentTemplate>
        <%#DataBinder.Eval(Container.DataItem, "CompanyName") %><br />
        <%#DataBinder.Eval(Container.DataItem, "Street")%><br />
        <%#DataBinder.Eval(Container.DataItem, "City")%><br />
        <%#DataBinder.Eval(Container.DataItem, "StateOfFacility")%><br />
        <%#DataBinder.Eval(Container.DataItem, "ZipCode")%><br />
        <%#DataBinder.Eval(Container.DataItem, "Phone")%><br />
        <%#DataBinder.Eval(Container.DataItem, "URL")%><br />
        </ContentTemplate>
 </ajaxToolkit:Accordion>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T22:14:33+00:00Added an answer on June 13, 2026 at 10:14 pm

    Use LinkButton in header and handle ItemCommand event of Accordion as below:

     <HeaderTemplate>
          <asp:LinkButton runat="server" Text='<%# Eval("CompanyName") %>'  
               CommandName="Select" CommandArgument='<%# (int)Eval("Id")  %>' />
     </HeaderTemplate>
    
    void acc1_ItemCommand(object sender, CommandEventArgs e)
    {
        if (e.CommandName == "Select")
        {
            var companyId = e.CommandArgument;
        }
    }
    

    Draw your attention that you need to provide companies unique identifier to distinguish clicked company pane.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to add a file upload function to an ASP.NET website and would
I am working on an ASP.NET website with sql server 2008 R2. i need
I need to use jquery tabs in my asp.net website with ajax mode to
I need to connect a SQL Server 2008 database to an asp.net website project.
I am building an asp.net website where I need a horizontal asp menu to
I'm using ASP.NET MVC to develop a website and I need to customize my
I have developed an ASP.NET MVC 2 website, and now need to deploy it
I need to secure my website without using the ASP.NET built in login controls
I am developing a website in asp.net using dotnetnuke cms. I need to add
I'm working with a intranet website written in ASP.NET and need to be able

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.