title: Cannot implicitly convert type 'string' to 'System.Web.UI.WebControls.Label'
body: <p>I am passing my values from a gridview to a different page row-wise.The table for the gridview in the database is as follows:</p>
  
  <pre><code> Create table Task
    (
      TaskId int Identity(1,1),
       Title varchar(100),
       Body varchar(500),
       Reward decimal(4,2),
      TimeAllotted int,
      PosterName varchar(100)
    )
  </code></pre>
  
  <p>the code -behind for the details page is as below:</p>
  
  <pre><code> 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("GridView1");
          GridViewRow row = GridView1.Rows[rowIndex];
          lblTaskId.Text = row.Cells[0].Text;
          lblTitle.Text = row.Cells[1].Text;
          lblBody.Text = row.Cells[2].Text;
          lblReward.Text = row.Cells[3].Text;
          lblTimeAllotted = row.Cells[4].Text;
          lblPosterName = row.Cells[5].Text;
  
  
      }
  }
  </code></pre>
  
  <p>It displays everything as desired but when I click on 'view task' in a particular row of the gridview, I get an exception Cannot implicitly convert type 'string' to 'System.Web.UI.WebControls.Label'. The exception occurs on the last two lines i.e</p>
  
  <pre><code>    lblTimeAllotted = row.Cells[4].Text;
      lblPosterName = row.Cells[5].Text;
  </code></pre>
  
  <p>How can I correct this?</p>