The events of the controls do not cause Postback in Firefox

0

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.

    
asked by Anibal Díaz 28.03.2017 в 17:19
source

1 answer

0

SOLVED

I found the problem.

My application uses an HttpModule to manage decorated URLs. This HttpModule, depending on the case that is presented, executes a RewritePath or a ServerTransfer to redirect the Request of the client.

The problem was in the ServerTransfer, since it was only indicating the Path parameter, and I had to add the preseveForm parameter with "true" value.

    
answered by 11.04.2017 / 09:56
source