title: prevent the post back vb and javascript
body: <p>this is a post back problem (I don't want to use the client side to solve this issue , there must be a way to prevent the postBack then using the client side ) , i have a button when clicked it calls a javascript function from the code behind , but before it does this it post back the page , Question is : how can i skip the post back step and jump to the javascript part ??</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      function hello(name) {
          alert("hello world from javascript " + name)
          return false;
      }
  &lt;/script&gt;
   &lt;/head&gt;
   &lt;body&gt;
  &lt;form id="form1" runat="server"&gt;
  &lt;div&gt;
      &lt;asp:Button ID="Button1" runat="server" Text="Button" /&gt;
  &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>code Behind : </p>
  
  <pre><code>    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click
      Dim Myname As String = "myName"
      Dim cstype As Type = Me.GetType()
      Page.ClientScript.RegisterStartupScript(cstype, "MyKey", "hello('" &amp; Myname &amp; "');", True)
  
  End Sub
  </code></pre>