button控件的CommandArgument属性值应该设置为什么?
if (e.CommandName == "Add")
{
foreach (GridViewRow row in this.GridView1.Rows)
{
if (this.GridView1.DataKeys[row.RowIndex].Value.ToString() == e.CommandArgument.ToString())
{
TextBox txt = (TextBox)row.FindControl("txtType");
string strConn = ConfigurationManager.ConnectionStrings["DB_website"].ConnectionString;
SqlDataSource ds = new SqlDataSource();
ds.ConnectionString = strConn;
ds.InsertCommand = string.Format("insert into tb_websitetype values({0},'{1}')", 1, txt.Text);
if (ds.Insert() > 0)
{
wmb.MessageBox("添加类型成功~");
DropDownList ddl = (DropDownList)row.FindControl("ddl");
ddl.DataBind();
}
}
}
}
在这段代码中,e.CommandArgument的值会是什么? 那么button属性的CommandArgument值应该设置为什么?