Zdravim, Tak sem se teda seznamil na vasich strankach s vasim problem :x add 1] Unikatni id k Labelu a ostatnim controls v Update Panelu mate, protoze je mate v DataListu (Datalist1_ctl00_Label1 , Datalist1_ctl01_Label1, Datalist1_ctl02_Label1 atd ...) add 2] Predchozi priklad je samozrejme pouzitelny i s daty z DB. Ve vasem pripade jsou tam samozrejme drobnejsi zmeny. Priklad je na repeatru s daty z DB.
<asp:Repeater ID="Repeater1" runat="server">
<ItemTemplate>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div>
idFoto:
<%#Eval("idPhoto")%></div>
<br />
<div>
Pocet Hlasu:
<%#Eval("Hlasy")%></div>
<br />
<asp:LinkButton ID="LinkButton1" runat="server" CommandArgument='<%#Eval("idPhoto")%>' CommandName="update">hlasuj</asp:LinkButton>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Repeater1" EventName="ItemCommand" />
</Triggers>
</asp:UpdatePanel>
</ItemTemplate>
</asp:Repeater>
Protected Sub Repeater1_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.RepeaterCommandEventArgs) Handles Repeater1.ItemCommand
If e.CommandName = "update" Then
' UPDATE command celkovych Hlasu
' SELECT command celkovych Hlasu + databind
End If
End Sub
|