问:
要获得MA金额的值如何获得
<项目模板>
项目模板>
问题补充:代表GridView中的数据批量修改,用FindControl获得
cmd.CommandType = CommandType.Text;
cmd.CommandText =“更新 yf_Purchases 设置Main=@Main , MAmount=@MAmount,MOverDate=@MOverDate,MMPrice=@MMPrice其中OrderID=@OrderID ”;
cmd.Parameters.Add("@OrderId", SqlDbType.NVarChar, 20);
cmd.Parameters.Add("@Main", SqlDbType.NVarChar, 10);
cmd.Parameters.Add("@MAmount", SqlDbType.Int);
cmd.Parameters.Add("@MOverDate", SqlDbType.VarChar,50);
cmd.Parameters.Add("@MMPrice", SqlDbType.Int);
cmd.Parameters["@OrderId"].Value = ((HiddenField)gvr.FindControl("OrderID")).Value;
cmd.Parameters["@Main"].Value = ((TextBox)gvr.FindControl("Main")).Text;
cmd.Parameters["@MAmount"].Value =?
答:
例子:
protected void GridView1_RowDataBound(对象发送者,GridViewRowEventArgs e)
{
尝试
{
if (e.Row.Cells[12].Text.ToString() == "提交待审核" || e.Row.Cells[12].Text.ToString() == "审核通过")
{
标签 lbl_edit = e.Row.FindControl("Label1_edit") as Label;
标签 lbl_editr = e.Row.FindControl("Label1_editr") 作为标签;
lbl_edit.Visible = false;
lbl_editr.Text =“”;
lbl_editr.Visible = true;
}
}
抓住 { }
}