Not much nonsense.Code
Front-end code:
<Asp: repeater id = "repeater3" runat = "server"> <itemtemplate> <Div class = "line_item"> <a href = "line. aspx? Line_id = <% # eval ("ID") %> "> <% # eval (" title ") %> </a> <span style =" color: RGB (136,136,136); float: Right; margin-Right: 90px; "> <% # eval (" price ") %> RMB/person </span> <asp: hiddenfield id = "lineid" runat = "server" value = '<% # eval ("ID") %>'/> <asp: button id = "button1" onclick = "advance" style = "float: Right; margin-Right:-120px; margin-top:-4px; "runat =" server "text =" Reservation "/> </div> </itemtemplate> </ASP: repeater>
Background code:
# region protected void advance (Object sender, eventargs e) {button bt = sender as button; repeateritem rI = BT. parent as repeateritem; hiddenfield Tx = Ri. findcontrol ("lineid") as hiddenfield; If (! Object. Equals (TX, null) {response. Write (TX. Value) ;}# endregion