如何得到gridview中模板列的控件
ScriptManager.RegisterClientScriptBlock(this.GridView1.Rows[].FindControl("LinkButton1"), typeof(GridView), "ERROR2", "alert('对不起,这个类别下还有商品存在,你不能删除!')", true);
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "Delete")
{
int id = Convert.ToInt32(e.CommandArgument);
IList<Commodity> comodities = CommodityManager.GetCommoditiesByJewelryTypeId(id);
if (comodities == null || comodities.Count == 0)
{
JewelryTypeManager.DeleteJewelryTypeById(id);
}
else
{
Response.Write("alert('对不起,这个类别下还有商品存在,你不能删除!')");
//ScriptManager.RegisterClientScriptBlock(this.GridView1.Rows[].FindControl("LinkButton1"), typeof(GridView), "ERROR2", "alert('对不起,这个类别下还有商品存在,你不能删除!')", true);
}
}
}
Rows[]中的行号怎么得到?