Ok, this is a strange one.
I am using .net framework 4.
I have an asp.net button within an updatepanel, like this:
<asp:Button id="btNacinMontaze" runat="server" class="buttonOIHidden" value="nm" CausesValidation="false" onclick="btNacinMontaze_Clicked" clientidmode="Static" UseSubmitBehavior="false"/>
If I click on it within a browser it works correctly – updatepanel updates itself without refreshing the whole page, correct server events gets triggered.
if i do from within the page this:
document.getElementById("btNacinMontaze").click();
the whole page refreshes and the correct server event gets triggered.
If I issue the same line of code from within the firebug console, just the updatePanel refreshes.
If I load the same page in Chrome or IE9 it works ok in all cases.
I’ve tracked what is different between click by mouse and click by code by debugging in Firebug, and saw that in the Sys$WebForms$PageRequestManager$_doPostBack method the line
if (!this._postBackSettings.async)
is different. async is true on click by mouse, and false by code click.
I am out of ideas as to why this happens and any help is much appreciated.
You should define an
AsyncPostBackTriggerto stop the entire page refresh.