Hi Am trying to pass values from gridView to a textbox in another page and i get the following error
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
Line 10: protected void Page_Load(object sender, EventArgs e)
Line 11: {
Line 12: this.txtPatientName.Text = Request.QueryString["name"].ToString()
Line 13: }
Line 14: }
Below is the code from my first page
foreach (GridViewRow row in grdAvailableStuff.Rows)
{
string name = row.Cells[1].Text;
string time = row.Cells[2].Text;
Response.Redirect("AddPatients.aspx?name=" + name.ToString());
}
Then below is my second page
protected void Page_Load(object sender, EventArgs e)
{
this.txtPatientName.Text = Request.QueryString["name"].ToString();
}