The same page works correctly in IE and Chrome.
<button id="BCrearB" type="button" class="button-green" title="Construye una encuesta nueva" onclick="DoPostBack('BCrearB');">
<img src="/NuevaEncuesta.png">
<span id="NuevaEnc">Nueva encuesta</span>
</button>
The DoPostBack function uses AJAX methods and is responsible for doing some checks to then call the __doPostBack () ASP.NET function
function DoPostBack(Boton)
{
TMisEncuestas.DoPostBack(Boton, SL, CallBackDoPostBack);
}
function CallBackDoPostBack(Resultado)
{
if (Resultado.value)
{
if (Resultado.value[4])
{
Compartir(Resultado.value[4]);
}
else if (Resultado.value[3])
{
CopiarMover(Resultado.value[3]);
}
else if (Resultado.value[2])
{
Aviso(Resultado.value[2])
}
else
{
ESDoPostBack(Resultado.value[0], Resultado.value[1]);
}
}
}
function ESDoPostBack(Boton, Parametro) {
$("#TAJAXUtil_Espere").espere("enable");
__doPostBack(Boton, Parametro);
}
var theForm = document.forms['form'];
if (!theForm) {
theForm = document.form;
}
function __doPostBack(eventTarget, eventArgument) {
if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
theForm.__EVENTTARGET.value = eventTarget;
theForm.__EVENTARGUMENT.value = eventArgument;
theForm.submit();
}
}
The __doPostBack sends the request to the OnLoad of the page, In the code-behind of the webform it asks for the property Page.isPostback, in IE and Chrome is "true", in Firefox it is "false" .
The same goes for webcontrols that have events assigned from the code.
<input type="submit" name="ctl00$ContentPlaceHolder$ctl109" value="Pregunta (+)" title="Pulsa para añadir una pregunta al final de la página 1" class="Boton">
I can not understand why Firefox submits these controls are not Postback.
Does anyone help me please?
* EDITO adding the javascript code, but I insist that the problem is not there, since the input does a SUBMIT, not a __doPostBack and it happens exactly the same.