我正在研究 asp.net GridView 控件。现在我需要编辑一些行数据。为此,我使用了以下代码:
<asp:LinkButton ID="btnEdit" Text="Edit" runat="server" CommandName="QuickEdit" OnClick="btnEdit_Click"
CommandArgument ='<%# ((CheckBox)(((GridViewRow) Container).Cells[4].Controls[0])).Checked %>'/>
btnEdit_Click
方法是:
protected void btnEdit_Click(object sender,EventArgs e)
{
LinkButton btn = (LinkButton)sender;
switch (btn.CommandName)
{
case "QuickEdit":
EditPanel.Visible = true;
GridPanel.Visible = false;
CheckBox cbRequiresState = (CheckBox)EditPanel.FindControl("checkRequiresState");
if (btn.CommandArgument =="True")
{
cbRequiresState.Checked = true;
}
else
{
cbRequiresState.Checked = false;
}
break;
}
}
CommandArgument
现在,我需要为该btnEdit_Click
方法传递多个参数。为此我需要做什么?请建议我在该方法中利用这些论点的好方法。