【发布时间】:2015-12-23 01:57:24
【问题描述】:
下面是我们想要的页面中编写的代码..
protected void Page_Load(object sender, EventArgs e)
{
if (this.Page.PreviousPage != null)
{
int rowIndex = int.Parse(Request.QueryString["RowIndex"]);
GridView GridView1 = (GridView)this.Page.PreviousPage.FindControl("gv1");
GridViewRow row;
row = GridView1.Rows[rowIndex];
lblid.Text = row.Cells[1].Text;
lblname.Text = (row.FindControl("lblName") as Label).Text;
lblmt.Text = row.Cells[3].Text;
lblyer.Text = row.Cells[4].Text;
}
}
【问题讨论】:
-
把你要来这个代码的代码。理想情况下,您应该从 gridview 本身发送值。