grdStudent.DataSource = ds.Tables[0]; grdStudent.DataBind(); lblConnectionState.Text = "RESULTS RETURNED"; } protected void grdStudent_SelectedIndexChanged(object sender, EventArgs e) { //GridViewRow row = new GridViewRow(); Session.Add("last_name", grdStudent.SelectedRow.Cells[1].Text); Session.Add("other_names", grdStudent.SelectedRow.Cells[2].Text); Session.Add("marital_status", grdStudent.SelectedRow.Cells[3].Text); if (IsPostBack) { txtLastname.Text = Session["last_name"].ToString(); txtOthernames.Text = Session["other_names"].ToString(); ddlMaritalStatus.SelectedValue = Session["marital_status"].ToString(); } }
<pre lang="cs">grdStudent.DataSource = ds.Tables[0];
Session.Add("last_name", grdStudent.SelectedRow.Cells[1].Text);
Session
last_name
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)