在GridView中点击该行的编辑怎样获取该行的值传给另一个Web窗体的文本框 ASP.NET
RT,希望前辈们给点代码参考下,小菜刚学ASP.NETstring_id=Gridview1.SelectedRow.Cells[1].Text.Trim();Respo...
RT,希望前辈们给点代码参考下,小菜刚学ASP.NET string _id = Gridview1.SelectedRow.Cells[1].Text.Trim();Response.Write("");
展开
1个回答
2013-11-23
展开全部
RowDataBound里e.Row.Attributes.Add("onDblClick", "javascript:window.opener.location.href='子窗体B.aspx?id="+e.Row.Cells[1].Text.ToString() + "';window.close();"); e.Row.Attributes.Add("onDblClick", "javascript:window.opener.documentById('txt').value='"+e.Row.Cells[1].Text.ToString() + "';window.close();"); protected void gv_RowUpdating(object sender, GridViewUpdateEventArgs e) { this.gv.EditIndex = e.RowIndex; int id = int.Parse(this.gv.DataKeys[e.RowIndex].Value.ToString()); string str = ((TextBox)this.gvTarget.Rows[e.RowIndex].FindControl("txt")).Text.Trim(); Response.Write("");}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询