c# - Binding data to a Button in repeater -


i have repeater has hidden field of parking_id <asp:hiddenfield value='<%# eval("parking_id") %>' id="hiddenfield1" runat="server" /> , button under it.

i tried binding value button html, giving me error indicates binding did not work. programming language form c#

how can bind value of parking_id button in order pass value form? , how can passed other form?

regards.

why not directly set value button's commandargument property ?

for example...

<asp:button id="button1" runat="server" text="button" commandargument='<%# eval("parking_id") %>' />

and in code behind...

protected void repeater1_itemcommand(object source, repeatercommandeventargs e) {     int32 value = convert.toint32(e.commandargument);     response.redirect("url?id=" + value.tostring()); } 

Comments