Stop event in c# through javascript
<p>I have page with 2 textboxes and button. When I press the button, some event appears on the server. But I need to check case if textboxes are empty. So I've made 2 events for button <code>onclick="Button1_Click" onclientclick="Button1_javaEvent()"</code>. In event Button1_javaEvent I check this case. Is it possible to stop Button1_Click in javascript if textboxes are empty and how???</p>

<pre><code> function Button1_javaEvent() {
        var flag = false;
        var message_str = "";
        if (main_form.Text_login.value == "") {
                message_str += "Enter the login";
                message_str += "\n";
                flag = true;
            }
         if (main_form.Password_login.value == "") {
                message_str += "Enter the password";
                flag = true;
             }
             if (flag == true) {
                 alert(message_str);
             }
             else {                  
                   ????????????         
             }
         }
</code></pre>
