Javascript: How to get the ClientID of the button that was clicked?
<p>Here's the button.</p>

<pre><code>&lt;asp:Button ID="_btnSearch" Text="Search" onclientclick="return CheckForEmptySearchBox(this.ClientID)" /&gt;
</code></pre>

<p>And here's the Javascript function</p>

<pre><code>&lt;script type = "text/javascript"&gt;
        function CheckForEmptySearchBox(id) {
           alert("The ID of the button is: " + id)

           return false;
        }
&lt;/script&gt;
</code></pre>

<p>I'm getting a alert box, saying "The ID of the button is: <strong>undefined</strong>"</p>

<p>Thanks for helping</p>
