I have a JuiceUI button control that I use to post a form. When I do I get a double postback. I noticed double entries in my DB and thought maybe I was double clicking on the button, but as I have debugged this I have found out that it is not the case. I have put a breakpoint in the postback function and it is indeed being called twice, with the stacktrace looking the same each time. Not sure what is going on. Any help would be appreciated. See below my code for the button control.
<button id="mBtnPrevious" runat="server" onserverclick="BtnPreviousClick">Previous</button>
<juice:Button TargetControlID="mBtnPrevious" runat="server" />
This doesn’t seem to be a JuiceUI issue. I resolved this by making the following change (notice the type=”button”):
to
This appears to be a browser compatibility issue as it didn’t double postback some browsers but did in others. It looks like on some browsers it was it was using type=”submit” as default which may have been causing the double postback.