展开全部
前台:
<asp:Repeater ID="rpt_hpmu" runat="server" OnItemCommand="rpt_hpmu_ItemCommand">
<ItemTemplate>
<tr>
<td align="center">
<asp:LinkButton ID="lbn_check" runat="server" CommandArgument='<%# Eval("Id") %>'
CommandName="check" Text="选择" ></asp:LinkButton>
</td>
</tr>
</ItemTemplate>
</asp:Repeater>
后台获取:
protected void rpt_hpmu_ItemCommand(object source, RepeaterCommandEventArgs e)
{
string cmdArg = e.CommandArgument.ToString();
string cmdName = e.CommandName.ToString();
if (cmdName == "check")
{
id=cmdArg ;//他就是要获取的Id
}
}
<asp:Repeater ID="rpt_hpmu" runat="server" OnItemCommand="rpt_hpmu_ItemCommand">
<ItemTemplate>
<tr>
<td align="center">
<asp:LinkButton ID="lbn_check" runat="server" CommandArgument='<%# Eval("Id") %>'
CommandName="check" Text="选择" ></asp:LinkButton>
</td>
</tr>
</ItemTemplate>
</asp:Repeater>
后台获取:
protected void rpt_hpmu_ItemCommand(object source, RepeaterCommandEventArgs e)
{
string cmdArg = e.CommandArgument.ToString();
string cmdName = e.CommandName.ToString();
if (cmdName == "check")
{
id=cmdArg ;//他就是要获取的Id
}
}
来自:求助得到的回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询