badassmark24
New Member
\[code\]<asp:Repeater ID="rptHotels" runat="server" OnItemDataBound="rptHotels_ItemDataBound"> <ItemTemplate> <div class="hotel-box"> <div class="hotel-img"> <asp:HiddenField ID="hdnHotelCode" runat="server" Value='http://stackoverflow.com/questions/14549291/<%#Eval("HotelCode")%>' /> <a class="preview" href='http://stackoverflow.com/questions/14549291/<%#Eval("ImageURL_Text") %>' title='<%#Eval("HotelName")%>' target="_blank"> <img src='http://stackoverflow.com/questions/14549291/<%#Eval("ImageURL_Text") %>' alt='<%#Eval("HotelName")%>' height="75px" width="100px" /> </a> </div> <div class="hotel_heeading_content"> <div class="hotel_heading"> <h2> <asp:LinkButton ID="lnkHotelDetail" runat="server" OnClick="lnkHotelDetail_Click"> <%#Eval("HotelName")%> ( <%#Eval("boardType")%>) </asp:LinkButton> </h2> </div> <div class="stars"> <span class="stars"> <%#Eval("StarRating")%></span> </div> <div class="hotel_text"> <%#Eval("HotelAddress")%>, <%#Eval("Destination")%> ,<%#Eval("Country")%> <img src="http://stackoverflow.com/questions/14549291/images/ico_point2.png" alt="" id="mapicon" class="mapicon" /> <input type="hidden" id="hdnLatitude" class="hdnLatitude" runat="server" value='http://stackoverflow.com/questions/14549291/<%#Eval("Latitude")%>' /> <input type="hidden" id="hdnLongitude" class="hdnLongitude" runat="server" value='http://stackoverflow.com/questions/14549291/<%#Eval("Longitude")%>' /> <input type="hidden" id="hdnInfoWindow" class="hdnInfoWindow" runat="server" /> </div> </div> <p> <asp:Literal ID="ltDes" runat="server"></asp:Literal> </p> <p> <a href="http://stackoverflow.com/questions/14549291/#">more info</a> </p> <div class="btn"> <asp:LinkButton ID="lnkPrice" runat="server" Text=' <%#Eval("totalPrice")%>' OnClick="lnkHotelDetail_Click" ></asp:LinkButton> </div> <div class="roominfo"> <asp:Repeater ID="rptRooms" runat="server"> <HeaderTemplate> <div class="rooms"> <div class="roominfoheader"> <div class="roomheaderlbl"> Room Name</div> <div class="roomheaderlbl"> Total Room Rate</div> <div class="roomheaderlbl"> Book Now</div> </div> </div> </HeaderTemplate> <ItemTemplate> <div class="rooms"> <div class="roominforow"> <div class="roominforowlbl"> <asp:Label ID="lblRoomName" runat="server" Text='<%#Eval("roomCategory") %>'></asp:Label></div> <div class="roominforowlbl"> $ <asp:Label ID="Label1" runat="server" Text='<%#Eval("totalRoomRate") %>'></asp:Label></div> <div class="roominforowlbl"> <asp:LinkButton ID="lnkBookNow" runat="server" Text="Book Now" OnClick="lnkBookNow_Click"></asp:LinkButton></div> </div> </div> </ItemTemplate> </asp:Repeater> </div> </div> </ItemTemplate> </asp:Repeater>\[/code\]I have above HTML for nested repeater .I am able to find the hidden field value which contain hotel Code by following method \[code\]protected void lnkHotelDetail_Click(object sender, EventArgs e) { LinkButton btn = (LinkButton)sender; var item = (RepeaterItem)btn.NamingContainer; HiddenField hdnHotelCode = (HiddenField)item.FindControl("hdnHotelCode"); }\[/code\]but the problem is now i have to find the hidden field value when a nested repeater item template link button is clicked .You can check that lnkBookNow is link button which is inside the \[code\]rptRooms\[/code\] repeater. \[code\]protected void lnkBookNow_Click(object sender, EventArgs e) { LinkButton btn = (LinkButton)sender; var item = (RepeaterItem)btn.NamingContainer; HiddenField hdnHotelCode = (HiddenField)item.FindControl("hdnHotelCode"); }\[/code\]I tried something like this but its not finding hidden field.