title: ASP.Net PostbackURL doesn't work if I put in Javascript Validation
body: <p>I have a usercontrol in ASP.Net featuring a button that I use to postback. This button also has some Javascript validation that is done before it processes the event.</p>
  
  <p>Today I tried to postback to another URL by setting the PostBackURL property of the button. But it didn't work and the page kept posting back to itself. So I did some investigation and found that.</p>
  
  <ol>
  <li>Post back to another URL is implemented through Javascript in ASP.Net.</li>
  <li><p>If I keep the call to my validation function </p>
  
  <p>OnClientClick="return validate()"
  Then the post back does not occur.</p></li>
  <li>If I remove the call to the validation function, the postback works fine.</li>
  </ol>
  
  <p>This is how the button markup looks with Validation on.</p>
  
  <pre><code>&lt;input type="submit" name="ctl00$cphMain$pra1$btnSubmit" value="Submit" onclick="return validate();WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&amp;quot;ctl00$cphMain$pra1$btnSubmit&amp;quot;, &amp;quot;&amp;quot;, false, &amp;quot;&amp;quot;, &amp;quot;Result.aspx&amp;quot;, false, false))" id="ctl00_cphMain_pra1_btnSubmit" style="width:80px;" /&gt;
  </code></pre>
  
  <p>Without validation</p>
  
  <pre><code>&lt;input type="submit" name="ctl00$cphMain$pra1$btnSubmit" value="Submit" onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&amp;quot;ctl00$cphMain$pra1$btnSubmit&amp;quot;, &amp;quot;&amp;quot;, false, &amp;quot;&amp;quot;, &amp;quot;Result.aspx&amp;quot;, false, false))" id="ctl00_cphMain_pra1_btnSubmit" style="width:80px;" /&gt;
  </code></pre>
  
  <p>You'll notice that the call to 'return validate()' is missing, and that is making all the difference.</p>
  
  <p>How can I get this to work?</p>