Custom KeyDown Control
<p>I am very new to ASP.NET and this is my first job and I need to perfom good. </p>

<p>I am stuck on this search page where I have two text boxes. One searches by ID which is int, the second by last name. Both the searched populate a grid view. As per the requirement when the user types in last name and clicks search the grid view should populate which I got working. Now if the user stats typing in the ID Search text box the Lastname Search text box should clear as well as the grid view that had gotten populated should be hidden.</p>

<p>I achieved clearing the text box by using </p>

<pre><code>txtSNumberSearch.Attributes["onKeyDown"] = "clearTextBox(this.id)";

txtSNumberSearch.Attributes.Add("onKeyDown", string.Format("document.getElementById('{0}').innerText='';", txtLastNameSearch.ClientID));

txtLastNameSearch.Attributes.Add("onKeyDown", string.Format("document.getElementById('{0}').innerText='';", txtSNumberSearch.ClientID));
</code></pre>

<p>But am not able to clear or hide the grid view on key down in the text box, my boss says I need to create a custom key down event handler. I do not know how to do it. Any help would be appreciated as I really need to perform at this job.</p>
