//删除
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
string id = GridView1.DataKeys[e.RowIndex].Value.ToString();
DeleteContent(id);
bind();
}
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
string id = GridView1.DataKeys[e.RowIndex].Value.ToString();
DeleteContent(id);
bind();
}
解决方案 »
- IIS超频繁报错,应用程序池错误重启W3WP进程 ,求解决之道!问题解决,马上给分!
- vs2008 asp.net解决方案,怎样将类文件从一个目录移动到另外一个目录?
- 求两个日期相加的函数
- 请教,服务端如何验证WSE2.0的SOAP消息?
- 各位:导出数据到Excel的数量瓶颈问题,如何解决?
- 求一个思路。
- 求高手看看,这段代码那里出错了!
- 求助,在线等待,超级郁闷,请遇到的朋友帮忙解决
- CustomValidator不显示错误信息
- 为什么在我的win2000 advanced server 安装host itergration server 老是装到一半就失败了呢?????
- [非专业人士求助]类似于<%=BsAddress%>格式的表达式,其值到哪里找?
- 移动公司辅助缴费系统
必须把该GridView的KeyField设置为DataTable中对应的id的字段名字
protected void dgBulletinSys_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
objData = new Data();
//获取UserId字段
//string id = this.dgBulletinSys.Columns[0].AccessibleHeaderText.ToString();
string id=this.dgBulletinSys.DataKeys[e.RowIndex].Value.ToString();
objData.DeleteContent(id);
this.ShowData();
}
public void ShowData()
{
objData = new Data();
ds = new DataSet();
ds = objData.SelecALlData(); //获取所有的记录
this.dgBulletinSys.DataSource = ds;
this.dgBulletinSys.DataBind();
}