Click here to Skip to main content
16,018,529 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have one repeater control and inside that there is one item template with two "tr",first tr contains the items where as second tr contains one div tag and i want to perform show and hide action for this div when I will click on a button inside a first row,how can I achieve that I don't have any idea ,Please help me out.

What I have tried:

ASP.NET
<asp:Repeater ID="Repeatercntrl" runat="server" OnItemDataBound="Repeatercntrl_ItemDataBound" OnItemCommand="Repeatercntrl_ItemCommand">
           <ItemTemplate>
               <table class="table-hover active" id="tblSearchDetails">
                   <tr style="height: 100px; width: 100%">
                       <td style="padding-right: 20em">
                           <%# Eval("DepartureTime")%>---><%#Eval("ArrivalTime")%>
                       </td>
                       <td style="padding-left: 2em">
                           <table class="table-hover active">
                               <tr>
                                   <td style="color: darkblue">
                                       <%#Eval("TransportName")%>
                                   </td>
                               </tr>
                               <tr>
                                   <td>
                                       <%#Eval("BusName")%>
                                   </td>
                               </tr>
                           </table>
                       </td>
                       <td style="padding-left: 20em">
                           <table class="table-hover active">
                               <tr>
                                   <td style="padding-left: 2em">Rs.<%#Eval("Fare")%></td>
                                   <td>
                                       <asp:Button ID="btnSelect" class="selectButton" CssClass="btn btn-danger" runat="server" Text="Select Seats" CommandName="Display"  />
                                   </td>
                               </tr>
                               <tr>
                                   <td>Available Seats:<%#Eval("AvailableSeatCount")%> </td>
                               </tr>
                           </table>
                       </td>
                   </tr>
                   <tr id="divRow" runat="server">
                       <td colspan="3">
                           <div id="divLayout" runat="server">
                               <asp:Label ID="lblMsg" runat="server" Text="Layout"></asp:Label>
                           </div>
                       </td>
                   </tr>
               </table>
           </ItemTemplate>
       </asp:Repeater>
Posted

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900