Using the ontextchange event to update the database
<p>I am trying to use the onTextChange event to update the a textbox and then i am using a button to update it in the Database. Every time i try to use is it sets the value as "" i really dont know if i am doing something wrong or if i am doing it right. if someone could please help that would be great. thanks</p>

<p>Asp.net code:</p>

<pre><code>&lt;asp:TextBox ID="tbPLName" runat="server" OnTextChanged="tbPLName_TextChanged" /&gt;
&lt;asp:Button ID="btUpdate" runat="server" Text="Update Name" OnClick="btUpdate_Click"   /&gt;
</code></pre>

<p>C# code:</p>

<pre><code>string lastName;
protected void btUpdate_Click(object sender, EventArgs e)
    {
        tbCheck();
    }

    protected void tbPLName_TextChanged(object sender, EventArgs e)
    {
        lastName = tbPLName.Text;
    }
</code></pre>

<p>also if there is a better way of doing this please let me know. i really would like to do this the best way posible.</p>
