How to get values from templatefields in Grdiview SelectedIndexChanged
<p>I have a gridview and sqldatasource.</p>

<pre><code>protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
    {
        GridViewRow row = GridView1.SelectedRow;
        TextBox rrdp = (TextBox)row.FindControl("name");
        txt1.Text = rrdp.text.ToString()
    }
</code></pre>

<p>But I'm getting : Object reference not set to an instance of an object. at the txt1.text = //etc..</p>

<p>The columns are itemtemplates , the values are not nulls.</p>

<p>Thanks</p>
