title: stop postback from happening from cs
body: <p>My code is validating some fields from <code>cs</code> page, if <code>txtRedirectSource == txtRedirectLocation</code> I want to stop the function execution- something like:
  <code>e.preventDefault()</code> in jquery.</p>
  
  <pre><code>public int GetHtml() 
  {
       if (txtRedirectSource.Equals(txtRedirectLocation))
       {
          // e.preventDefault();
          // return false;
       }
  
       .... // the function continue
       .....
  }
  </code></pre>
  
  <p>I tried to use <code>return</code> and to <code>Throw</code> an exception - but those ended up with a postback which I don't want to happen</p>