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

  • SEARCH
  • Home
  • 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 8403615
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T22:23:29+00:00 2026-06-09T22:23:29+00:00

Ok so normally when I try to access elements of say a ListView on

  • 0

Ok so normally when I try to access elements of say a ListView on ItemDatabound, it’s as simple as saying e.Item.FindControl(“myControl”) but this doesn’t seem to be working for me using the Accordion from the ajaxtoolkit.

Here’s the markup:

    <ajaxToolkit:Accordion runat="server" ID="accOuterAccordion" OnItemDataBound="accOuterAccordion_ItemDataBound">
        <HeaderTemplate>
            <asp:Label runat="server" Text='<%#Eval("Header") %>'/>
        </HeaderTemplate>
        <ContentTemplate>
            <asp:ListView runat="server" ID="lvReviewers" ItemPlaceholderID="phReviewer">
                <LayoutTemplate>
                    <ul>
                        <asp:PlaceHolder runat="server" ID="phReviewer"/>
                    </ul>
                </LayoutTemplate>
                <ItemTemplate>
                    <li>
                        <asp:Label runat="server" ID="lblReviewer" Text='<%#Eval("Assignee.Name") %>'/>
                    </li>
                </ItemTemplate>
            </asp:ListView>
        </ContentTemplate>
    </ajaxToolkit:Accordion>

And here’s the codebehind for the OnItemDataBound event:

   protected void accOuterAccordion_ItemDataBound(object sender, AjaxControlToolkit.AccordionItemEventArgs e)
    {
        var item = e.AccordionItem.DataItem as MocRequest;
        var innerList = e.AccordionItem.FindControl("lvReviewers") as ListView;
        innerList.DataSource = MocApi.GetReviews(item.MocRequestID);
        innerList.DataBind();
    }

When I step through the code, item is getting the loaded item correctly. However, innerList is coming back as null. Any ideas?

  • 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-09T22:23:31+00:00Added an answer on June 9, 2026 at 10:23 pm

    Check for the ItemType property of AccordionItemEventArgs class.

    void Accordion1_ItemDataBound(object sender, AjaxControlToolkit.AccordionItemEventArgs e)
    {
        if (e.ItemType == AjaxControlToolkit.AccordionItemType.Content)
        {
            var item = e.AccordionItem.DataItem as MocRequest;
            var innerList = e.AccordionItem.FindControl("lvReviewers") as ListView;
            innerList.DataSource = MocApi.GetReviews(item.MocRequestID);
            innerList.DataBind();
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The author of this article states that Normally you don't want to have access
I use TortoiseSVN normally and it works fine. Whenever I try to use SVN
Normally, if I want to start a new activity I can use StartActivity(typeof(foo)); This
Normally the XML files I have to parse are like this: <row id=1> <title>widget<title>
My program requires access to a certain UNC path, but the path is cross-domain,
I have a object that is extended from arraycollection. This object has to access
So pretty straight forward but I cant find the answer. Say I have an
In CakePHP when you try to access a protect action you are automatically taken
i get a bad_access error when i try to run my program, normally i
Normally you make a call to a service, it blocks until a thread in

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.