fetching value of more tha one label on click event of a button using repeater

flinongollisa

New Member
I'm trying ASP Repeater control.where i'm displaying the values from my Database using 3labels(which are inside repeater),also i can fetch the value of one label on click event of a button(which is also inside repeater)but,i want to fetch the values of all 3 labels on click of same buttonmy aspx file is :\[code\]<asp:Repeater ID="rptrHotel" runat="server" onitemcommand="rptrHotel_ItemCommand"> <HeaderTemplate> <table width="500px" class="bidTab"> <tr class="bidHeading"> <th> Hotel Name </th> <th> Room Type </th> <th> Bid </th> </tr> </HeaderTemplate> <ItemTemplate> <tr> <td> <asp:Label ID="lblHotelName" runat="server" Text='<%#Eval("hotel_name")%>'></asp:Label> </td> <td> <asp:Label ID="lblRoomType" runat="server" Text='<%#Eval("room_type_name")%>'></asp:Label> </td> <td> <asp:Label ID="lblBaseBidAmt" runat="server" Text='<%#Eval("base_bid_ammount")%>'></asp:Label> </td> <td> <asp:Button ID="btnBidNow" runat="server" Text="Bid Now" CommandName="BidNow" CommandArgument='<%#Eval("hotel_name") %>'/> </td> </tr> </ItemTemplate> <FooterTemplate> </table> </FooterTemplate> </asp:Repeater>\[/code\]and the code i have tried in aspx.cs file is : \[code\]protected void rptrHotel_ItemCommand(object source, RepeaterCommandEventArgs e) { if (e.CommandName == "BidNow") { Label hotel_name = e.Item.FindControl("lblHotelName") as Label; hotel_name.Text = e.CommandArgument.ToString(); Label room_type_name = e.Item.FindControl("lblRoomType") as Label; room_type_name.Text = e.CommandArgument.ToString(); Label base_bid_ammount = e.Item.FindControl("lblBaseBidAmt") as Label; base_bid_ammount.Text = e.CommandArgument.ToString(); lblhotelresult.Text = lblhotelresult.Text; lblRoomResult.Text = room_type_name.Text; lblBaseamtresult.Text = base_bid_ammount.Text; //Session["hotel_name"] = hotel_name.Text; //Session["room_type_name"] = room_type_name.Text; //Session["base_bid_ammount"] = base_bid_ammount.Text; //Response.Redirect("BidRoomCustomer.aspx"); } }\[/code\]Please suggest what could be done and help me accessing all the 3labels.
 
Back
Top