Click here to Skip to main content
11,929,283 members (59,787 online)
Rate this:
Please Sign up or sign in to vote.
See more: C# ASP.NET
Hi all i have a repeater control in which i have accordion.I cant access the value from database in accordion.In following code.In accordion i have Button2 and iam trying to assign a value as commandArgument but it always had null value.But if i write same code outside accordion it will works fine <%# DataBinder.Eval(Container.DataItem, "Wid")%>'
I have assigning data source in page_load event.All fields are visible outside the accordion but not in inside the Accordion.
code :
<asp:Repeater ID="Repeater1" runat="server" onitemdatabound="Repeater1_ItemDataBound">
   <asp:Image ID="Image1" runat="server" height="25px" Width="25px" ImageUrl='<%# DataBinder.Eval(Container.DataItem,"profilepic")%>' ToolTip='<%#DataBinder.Eval(Container.DataItem,"UserName")%>' />
   <%# DataBinder.Eval(Container.DataItem, "UserName") %>:
       <asp:Label ID="Label1" runat="server" Text=' <%# DataBinder.Eval(Container.DataItem, "WallStatus")%> ' ></asp:Label>
       <asp:Label ID="Label2" runat="server" Text=' <%# DataBinder.Eval(Container.DataItem, "Wid")%> ' Visible="true"></asp:Label><br />
       <div style="background-color:Gray;color:White;width:300px">
       <asp:Repeater ID="Repeater2" runat="server">
       <ItemTemplate><br />
            <asp:Image ID="Image1" runat="server" height="25px"
                ImageUrl='<%# DataBinder.Eval(Container.DataItem,"profilepic")%>'
                ToolTip='<%#DataBinder.Eval(Container.DataItem,"UserName")%>' Width="25px" />
            <%# DataBinder.Eval(Container.DataItem, "UserName")%>:
            <br />
            <%# DataBinder.Eval(Container.DataItem, "comment") %>
            <br />
            <br />
        <div style="background-color:Gray;color:White;width:300px" >
        <asp:Accordion ID="Accordion2" runat="server"  SelectedIndex="0" HeaderCssClass="HeaderCSS"
        ContentCssClass="accordionContent" AutoSize="None"
        FadeTransitions="true" TransitionDuration="250"
        FramesPerSecond="40" BorderColor="White"
              HeaderSelectedCssClass="HeaderSelectedCSS" Width="300px" OnItemCommand="Accordion_Click">
        <asp:AccordionPane ID="AccordionPane0" runat="server" >
            <Header><b>+ Add Comment</b></Header>
            <asp:Panel ID="Panel3" runat="server">
            <asp:ImageButton ID="ImageButton2" runat="server" ImageUrl="~/Image/user_3.png" Height="50" Width="50" BorderColor="white" BorderStyle="Solid" BorderWidth="2px"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <asp:TextBox ID="TextBox2" runat="server" Height="46px" Width="185px" TextMode="MultiLine" Text=' <%# DataBinder.Eval(Container.DataItem, "WallStatus")%> '></asp:TextBox>
            <br />
            <asp:Button ID="Button2" runat="server" Text="Comment" OnClick="Comment_Click"  CausesValidation="false" CommandName="CommentButton" CommandArgument ='<%# DataBinder.Eval(Container.DataItem, "Wid")%>'/>
        <asp:AccordionPane ID="AccordionPane1" runat="server">
  <SeparatorTemplate>    <br />**************************************************  <br />
Posted 24-Jan-13 9:50am
Edited 24-Jan-13 9:58am
Ruchin Munjal 24-Jan-13 15:05pm
can you share the code behind as well. You have a nested repeater. how are you binding the nested repeater?
sunil pol 25-Jan-13 13:33pm
hi Ruchin,there is no problem with repeater within repeater.Even in single repeater, accordion not showing any data.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.151126.1 | Last Updated 24 Jan 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100