버튼을 클릭했을 때 listview에서 레이블 컨트롤에 액세스해야합니다 (동일한 행에 있음) ...단추를 클릭하면 어떻게 ListView 내의 컨트롤에 액세스 할 수 있습니까?
누구든지이 작업을 수행하는 방법을 알고 있습니까? 뒤에
<asp:ListView ID="ListView1" runat="server" DataSourceID="DataSource">
<LayoutTemplate>//Etc </LayoutTemplate>
<ItemTemplate>
<asp:Label ID="lblDone" runat="server" Visible="false">Your vote has been counted</asp:Label>
<asp:Button ID="voteButton" runat="server" Text="Vote" CommandArgument='<%#Eval("id") %>' OnClick="voteOnThis" />
</ItemTemplate>
코드 : :(
이 ... 통찰력의 더 아래
ASPX 페이지를 참조하십시오
protected void voteOnThis(object sender, EventArgs e)
{
Button myButton = (Button)sender;
Voting.vote(int.Parse(myButton.CommandArgument));
// Here i would like to access the 'label' lblDone and make this Visible
}