I have searched for a solution to this for the last several hours but to no avail. When I click on a button that has a return false in OnClientClick, no postback occurs to the server. When I use jquery to trigger the click function of the button, OnClientClick fires first, but regardless of the return value, a postback occurs. Here's a simple sample...
k...Putting code that more accurately demonstrates the problem. Sorry for the mixup...
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<script src="script/jquery-1.4.2.js" type="text/javascript"></script>
</head>
<body>
<form id="form1" runat="server">
<div>
<img onclick="$('#Button1').click();" runat="server" width="100" height="100" style="border:solid 1px black" /><br />
<asp:Button ID="Button1" OnClick="Button1_Click" OnClientClick="return false;" runat="server" Text="Button" />
</div>
</form>
</body>
</html>
To answer some questions that were asked...I have a User Control. It is an rollover button using two images and a hidden button to call the server. The button uses Reflection to enable whatever OnClick handler is specified to call the function on the particular page that the control is on. The OnClientClick is also used to provide additional Javascript actions if I need them. Everything was working fine when I had an invisible but clickable button directly wired up. I decided to make the button truly invisible and not even display it, but that required me to have the Images actually fire the click event to the button.