.Net adds "__doPostBack" to javaScript onClick event... why?
<p>Typically.NET handles the post back event on a button by making the button a type="submit":</p>

<pre><code>&lt;input type="submit" Text="Delete" /&gt;
</code></pre>

<p>However, I've recently bumped into a situation where .NET is handling the post back by making the input a type="button" and then adding a javaScript onClick event to do the "__doPostBack()" - so you end up with this: </p>

<pre><code>&lt;input type="button" onClick="__doPostBack(...);" /&gt;
</code></pre>

<p>The problem with this is trying to add confirmation messages to the click. So with the 2nd scenario, I end up with this:</p>

<pre><code>&lt;input type="button" onClick="return confirm('Are you sure?'); __doPostBack(...);" Text="Delete" /&gt;
</code></pre>

<p>Of course, in the above scenario the postback will never happen.</p>

<p>What I'm wondering is why .net chooses one scenario over there other and is there a way to prevent the 2nd?</p>

<p>Thanks</p>
