Show or hide button based on textbox's value in ASP.NET
<p>I will hide the "login" button if both textbox (id and pass) is not filled.
Else I will show it.</p>

<p>inside the script block:</p>

<pre><code>protected void checkField(object sender, EventArgs e)
{
    if (id.Text == "" || pass.Text == "")
    {
        logbutton.Visible = false;
    }
    else if (id.Text != "" &amp;&amp; pass.Text != "")
        logbutton.Visible = true;
}
</code></pre>

<p>inside the form block i have two text box, one is for ID, one is for Password
Everytime I on blur or on focus (tried all of them) any of these two I will call the  function above</p>

<p>But I have never seen the "login" button showing / disappearing after modifying the two text boxes.</p>
