How to get values of textbox and dropdownlist controls in a gridview on a button click event?
<p>On the page load there will be gridview with a default row....there is a button with a + sign at the bottom...on the button click i want to create a new rows in the grid..before that i need to make sure that all fields have values.But I am getting null values..</p>

<p><img src="http://i.stack.imgur.com/bw0IK.png" alt="I want to get the value of textbox and dropdownlist controls (which are in a gridview)"></p>

<p>My code is:</p>

<pre><code>TextBox name_value = ((TextBox)Gridview1.Rows[0].FindControl("TextBox1"));
            TextBox age_value = ((TextBox)Gridview1.Rows[0].FindControl("TextBox2"));
            DropDownList sex_value = ((DropDownList)Gridview1.Rows[0].FindControl("DropDownList1"));
            DropDownList berth_value = ((DropDownList)Gridview1.Rows[0].FindControl("DropDownList2"));
</code></pre>

<p>Any help will be appreciated.</p>
