Firefox doPostBack (LinkButton) not working

Discussion in 'ASP .Net' started by Mark Olbert, Sep 27, 2005.

  1. Mark Olbert

    Mark Olbert Guest

    The doPostBack javascript functioning is not submitting the page when called by linkbuttons (or an
    autopostback checkbox, for that matter).

    I'm aware of a problem with Netscape browsers and the postback code, but I have a workaround for
    that installed (and it looks like the code generated by ASP.NET when it renders the page does the
    same thing, namely, setting document<[formname> = document.forms["<formname>"]). However, the
    problem still exists under firefox.

    Has anyone come up with a workaround for this incompatibility?

    - Mark
     
    Mark Olbert, Sep 27, 2005
    #1
    1. Advertising

  2. Hi Mark,

    Welcome to ASPNET newsgroup.
    As for the ASP.NET generated autopostback scripting problem on firefox,
    based on my research, for the __doPostBack script, it should works on both
    IE and other popular browser in clude Mozilla or the new firefox. And I've
    tested on my local environment through the latest firefox 1.7, here is the
    ASP.NET page generated script for __doPostBack function:

    =================
    <script language="javascript" type="text/javascript">
    <!--
    function __doPostBack(eventTarget, eventArgument) {
    var theform;
    if (window.navigator.appName.toLowerCase().indexOf("microsoft") > -1) {
    theform = document.Form1;
    }
    else {
    theform = document.forms["Form1"];
    }
    theform.__EVENTTARGET.value = eventTarget.split("$").join(":");
    theform.__EVENTARGUMENT.value = eventArgument;
    theform.submit();
    }
    // -->
    </script>
    ==================

    And the script can correctly postback (submit the form) from my local test
    environment(also tested through a Mozilla 1.6 client). Is it identical to
    the ones on your side? Have you also tested on some other machine or client
    to see whether you also encounter the same problem?

    Thanks,

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)

    --------------------
    | NNTP-Posting-Date: Tue, 27 Sep 2005 10:11:34 -0500
    | From: Mark Olbert <>
    | Newsgroups: microsoft.public.dotnet.framework.aspnet
    | Subject: Firefox doPostBack (LinkButton) not working
    | Date: Tue, 27 Sep 2005 08:11:32 -0700
    | Organization: Olbert & McHugh, LLC
    | Reply-To:
    | Message-ID: <>
    | X-Newsreader: Forte Agent 3.0/32.763
    | MIME-Version: 1.0
    | Content-Type: text/plain; charset=us-ascii
    | Content-Transfer-Encoding: 7bit
    | Lines: 11
    | X-Trace:
    sv3-VZODfTr23qFJeEe4lNHKZg2IFBOUm6pzkDOvHROXEuK2qDPZM5fpL7hT9PlSPDW8Jk/MGdxZ
    o00dBYS!DVvgqilOBH/ZuVYwLkplgXmQCMGZpRuEkAXk08QMxxppuizKi72hcOCknbhC0/97/O0P
    kA==
    | X-Complaints-To:
    | X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
    | X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
    | X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your
    complaint properly
    | X-Postfilter: 1.3.32
    | Path:
    TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-onli
    ne.de!border2.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.gigan
    ews.com!local01.nntp.dca.giganews.com!news.giganews.com.POSTED!not-for-mail
    | Xref: TK2MSFTNGXA01.phx.gbl
    microsoft.public.dotnet.framework.aspnet:127427
    | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    |
    | The doPostBack javascript functioning is not submitting the page when
    called by linkbuttons (or an
    | autopostback checkbox, for that matter).
    |
    | I'm aware of a problem with Netscape browsers and the postback code, but
    I have a workaround for
    | that installed (and it looks like the code generated by ASP.NET when it
    renders the page does the
    | same thing, namely, setting document<[formname> =
    document.forms["<formname>"]). However, the
    | problem still exists under firefox.
    |
    | Has anyone come up with a workaround for this incompatibility?
    |
    | - Mark
    |
     
    Steven Cheng[MSFT], Sep 28, 2005
    #2
    1. Advertising

  3. Mark Olbert

    KMA Guest

    Mark,

    I presume that you haven't got scripting turned off in Firefox security tab?

    "Mark Olbert" <> wrote in message
    news:...
    > The doPostBack javascript functioning is not submitting the page when

    called by linkbuttons (or an
    > autopostback checkbox, for that matter).
    >
    > I'm aware of a problem with Netscape browsers and the postback code, but I

    have a workaround for
    > that installed (and it looks like the code generated by ASP.NET when it

    renders the page does the
    > same thing, namely, setting document<[formname> =

    document.forms["<formname>"]). However, the
    > problem still exists under firefox.
    >
    > Has anyone come up with a workaround for this incompatibility?
    >
    > - Mark
     
    KMA, Sep 28, 2005
    #3
  4. Mark Olbert

    Mark Olbert Guest

    Nope, it's running.

    On Wed, 28 Sep 2005 10:56:46 +0200, "KMA" <> wrote:

    >Mark,
    >
    >I presume that you haven't got scripting turned off in Firefox security tab?
    >
     
    Mark Olbert, Sep 28, 2005
    #4
  5. Mark Olbert

    Mark Olbert Guest

    The only difference between the javascript functions is that the one on my page uses 'private'
    instead of 'Form1'.

    I checked the javascript console under Firefox when I'm on te problem page, and it turns out Firefox
    does >>not<< like having properties named 'private'. Changing the name of the form element solved
    the problem.

    I'm not sure how the form element got named private. I can't recall ever naming a form element; I
    just accept whatever default gets used when I create a page, or add one to a project.

    - Mark

    On Wed, 28 Sep 2005 03:10:32 GMT, (Steven Cheng[MSFT]) wrote:

    >Hi Mark,
    >
    >Welcome to ASPNET newsgroup.
    >As for the ASP.NET generated autopostback scripting problem on firefox,
    >based on my research, for the __doPostBack script, it should works on both
    >IE and other popular browser in clude Mozilla or the new firefox. And I've
    >tested on my local environment through the latest firefox 1.7, here is the
    >ASP.NET page generated script for __doPostBack function:
    >
    >=================
    ><script language="javascript" type="text/javascript">
    ><!--
    > function __doPostBack(eventTarget, eventArgument) {
    > var theform;
    > if (window.navigator.appName.toLowerCase().indexOf("microsoft") > -1) {
    > theform = document.Form1;
    > }
    > else {
    > theform = document.forms["Form1"];
    > }
    > theform.__EVENTTARGET.value = eventTarget.split("$").join(":");
    > theform.__EVENTARGUMENT.value = eventArgument;
    > theform.submit();
    > }
    >// -->
    ></script>
    >==================
    >
    >And the script can correctly postback (submit the form) from my local test
    >environment(also tested through a Mozilla 1.6 client). Is it identical to
    >the ones on your side? Have you also tested on some other machine or client
    >to see whether you also encounter the same problem?
    >
    >Thanks,
    >
    >Steven Cheng
    >Microsoft Online Support
    >
    >Get Secure! www.microsoft.com/security
    >(This posting is provided "AS IS", with no warranties, and confers no
    >rights.)
    >
    >--------------------
    >| NNTP-Posting-Date: Tue, 27 Sep 2005 10:11:34 -0500
    >| From: Mark Olbert <>
    >| Newsgroups: microsoft.public.dotnet.framework.aspnet
    >| Subject: Firefox doPostBack (LinkButton) not working
    >| Date: Tue, 27 Sep 2005 08:11:32 -0700
    >| Organization: Olbert & McHugh, LLC
    >| Reply-To:
    >| Message-ID: <>
    >| X-Newsreader: Forte Agent 3.0/32.763
    >| MIME-Version: 1.0
    >| Content-Type: text/plain; charset=us-ascii
    >| Content-Transfer-Encoding: 7bit
    >| Lines: 11
    >| X-Trace:
    >sv3-VZODfTr23qFJeEe4lNHKZg2IFBOUm6pzkDOvHROXEuK2qDPZM5fpL7hT9PlSPDW8Jk/MGdxZ
    >o00dBYS!DVvgqilOBH/ZuVYwLkplgXmQCMGZpRuEkAXk08QMxxppuizKi72hcOCknbhC0/97/O0P
    >kA==
    >| X-Complaints-To:
    >| X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
    >| X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
    >| X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your
    >complaint properly
    >| X-Postfilter: 1.3.32
    >| Path:
    >TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-onli
    >ne.de!border2.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.gigan
    >ews.com!local01.nntp.dca.giganews.com!news.giganews.com.POSTED!not-for-mail
    >| Xref: TK2MSFTNGXA01.phx.gbl
    >microsoft.public.dotnet.framework.aspnet:127427
    >| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    >|
    >| The doPostBack javascript functioning is not submitting the page when
    >called by linkbuttons (or an
    >| autopostback checkbox, for that matter).
    >|
    >| I'm aware of a problem with Netscape browsers and the postback code, but
    >I have a workaround for
    >| that installed (and it looks like the code generated by ASP.NET when it
    >renders the page does the
    >| same thing, namely, setting document<[formname> =
    >document.forms["<formname>"]). However, the
    >| problem still exists under firefox.
    >|
    >| Has anyone come up with a workaround for this incompatibility?
    >|
    >| - Mark
    >|
     
    Mark Olbert, Sep 28, 2005
    #5
  6. So it's just a naming issue due to browser specific rules. Anyway, glad
    that you've figured it out.
    If there're any further issues we can help, please feel free to post here.

    Thanks & Regards,

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)



    --------------------
    | NNTP-Posting-Date: Wed, 28 Sep 2005 10:04:02 -0500
    | From: Mark Olbert <>
    | Newsgroups: microsoft.public.dotnet.framework.aspnet
    | Subject: Re: Firefox doPostBack (LinkButton) not working
    | Date: Wed, 28 Sep 2005 08:04:03 -0700
    | Organization: Olbert & McHugh, LLC
    | Reply-To:
    | Message-ID: <>
    | References: <>
    <uOtG#>
    | X-Newsreader: Forte Agent 3.0/32.763
    | MIME-Version: 1.0
    | Content-Type: text/plain; charset=us-ascii
    | Content-Transfer-Encoding: 7bit
    | Lines: 104
    | X-Trace:
    sv3-3eEFmxjQOpk15Sa2Qh5xcYZRMV3DPMjHciTcUyxYIQLMu+doGpuwgskqHgd1FfbsOAIyIUzE
    NavGuTI!X9KwVCGigAtu4iFzNWCj4xF2R/xEp/2uQQCMsW1iF2fmHSsQ9xboMj1L38NXSFOt8sNQ
    pA==
    | X-Complaints-To:
    | X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
    | X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
    | X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your
    complaint properly
    | X-Postfilter: 1.3.32
    | Path:
    TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-onli
    ne.de!border2.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.gigan
    ews.com!local01.nntp.dca.giganews.com!news.giganews.com.POSTED!not-for-mail
    | Xref: TK2MSFTNGXA01.phx.gbl
    microsoft.public.dotnet.framework.aspnet:127709
    | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    |
    | The only difference between the javascript functions is that the one on
    my page uses 'private'
    | instead of 'Form1'.
    |
    | I checked the javascript console under Firefox when I'm on te problem
    page, and it turns out Firefox
    | does >>not<< like having properties named 'private'. Changing the name of
    the form element solved
    | the problem.
    |
    | I'm not sure how the form element got named private. I can't recall ever
    naming a form element; I
    | just accept whatever default gets used when I create a page, or add one
    to a project.
    |
    | - Mark
    |
    | On Wed, 28 Sep 2005 03:10:32 GMT, (Steven
    Cheng[MSFT]) wrote:
    |
    | >Hi Mark,
    | >
    | >Welcome to ASPNET newsgroup.
    | >As for the ASP.NET generated autopostback scripting problem on firefox,
    | >based on my research, for the __doPostBack script, it should works on
    both
    | >IE and other popular browser in clude Mozilla or the new firefox. And
    I've
    | >tested on my local environment through the latest firefox 1.7, here is
    the
    | >ASP.NET page generated script for __doPostBack function:
    | >
    | >=================
    | ><script language="javascript" type="text/javascript">
    | ><!--
    | > function __doPostBack(eventTarget, eventArgument) {
    | > var theform;
    | > if (window.navigator.appName.toLowerCase().indexOf("microsoft") > -1) {
    | > theform = document.Form1;
    | > }
    | > else {
    | > theform = document.forms["Form1"];
    | > }
    | > theform.__EVENTTARGET.value = eventTarget.split("$").join(":");
    | > theform.__EVENTARGUMENT.value = eventArgument;
    | > theform.submit();
    | > }
    | >// -->
    | ></script>
    | >==================
    | >
    | >And the script can correctly postback (submit the form) from my local
    test
    | >environment(also tested through a Mozilla 1.6 client). Is it identical
    to
    | >the ones on your side? Have you also tested on some other machine or
    client
    | >to see whether you also encounter the same problem?
    | >
    | >Thanks,
    | >
    | >Steven Cheng
    | >Microsoft Online Support
    | >
    | >Get Secure! www.microsoft.com/security
    | >(This posting is provided "AS IS", with no warranties, and confers no
    | >rights.)
    | >
    | >--------------------
    | >| NNTP-Posting-Date: Tue, 27 Sep 2005 10:11:34 -0500
    | >| From: Mark Olbert <>
    | >| Newsgroups: microsoft.public.dotnet.framework.aspnet
    | >| Subject: Firefox doPostBack (LinkButton) not working
    | >| Date: Tue, 27 Sep 2005 08:11:32 -0700
    | >| Organization: Olbert & McHugh, LLC
    | >| Reply-To:
    | >| Message-ID: <>
    | >| X-Newsreader: Forte Agent 3.0/32.763
    | >| MIME-Version: 1.0
    | >| Content-Type: text/plain; charset=us-ascii
    | >| Content-Transfer-Encoding: 7bit
    | >| Lines: 11
    | >| X-Trace:
    |
    >sv3-VZODfTr23qFJeEe4lNHKZg2IFBOUm6pzkDOvHROXEuK2qDPZM5fpL7hT9PlSPDW8Jk/MGdx

    Z
    |
    >o00dBYS!DVvgqilOBH/ZuVYwLkplgXmQCMGZpRuEkAXk08QMxxppuizKi72hcOCknbhC0/97/O0

    P
    | >kA==
    | >| X-Complaints-To:
    | >| X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
    | >| X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
    | >| X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your
    | >complaint properly
    | >| X-Postfilter: 1.3.32
    | >| Path:
    |
    >TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-onl

    i
    |
    >ne.de!border2.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giga

    n
    |
    >ews.com!local01.nntp.dca.giganews.com!news.giganews.com.POSTED!not-for-mail

    | >| Xref: TK2MSFTNGXA01.phx.gbl
    | >microsoft.public.dotnet.framework.aspnet:127427
    | >| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    | >|
    | >| The doPostBack javascript functioning is not submitting the page when
    | >called by linkbuttons (or an
    | >| autopostback checkbox, for that matter).
    | >|
    | >| I'm aware of a problem with Netscape browsers and the postback code,
    but
    | >I have a workaround for
    | >| that installed (and it looks like the code generated by ASP.NET when
    it
    | >renders the page does the
    | >| same thing, namely, setting document<[formname> =
    | >document.forms["<formname>"]). However, the
    | >| problem still exists under firefox.
    | >|
    | >| Has anyone come up with a workaround for this incompatibility?
    | >|
    | >| - Mark
    | >|
    |
     
    Steven Cheng[MSFT], Sep 29, 2005
    #6
  7. Mark Olbert

    cooplarsh Guest

    I had Firefox 1.0.x working fine with my ASP.NET 1.1 app, but then
    upgraded to 2.0, changed all of my pages to Master Pages that are XHTM
    1.1 transitional compliant, and upgraded Firefox to 1.5.x all at th
    same time. And now, although Opera and Netscape (using IE rendering a
    default instead of Firefox) work fine, I'm running into a problem wit
    any link buttons that do a postback on Firefox where nothing happen
    when I click

    I don't have an private variables variables, so I can't fix it tha
    easily. And the javascript I'm seeing generated to handle the postbac
    is a little different than the example you gave, e.g. mine is (se
    below). So I was wondering if you had any suggestions.

    theForm = document.forms['aspnetForm'];
    if (!theForm) {
    theForm = document.aspnetForm;
    }
    function __doPostBack(eventTarget, eventArgument) {
    if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
    theForm.__EVENTTARGET.value = eventTarget;
    theForm.__EVENTARGUMENT.value = eventArgument;
    theForm.submit();
    }
    }
    // --


    -
    cooplars
    -----------------------------------------------------------------------
    Posted via http://www.codecomments.co
    -----------------------------------------------------------------------
     
    cooplarsh, May 21, 2006
    #7
  8. Mark Olbert

    adyh

    Joined:
    Aug 17, 2007
    Messages:
    1
    Solve the problem on 2.0

    Thank God I found an usefull post in order to solve this issue in ASP.Net 2.0 and I want to share it with you.

    BE SURE that you have the form tag inside the body tag. That will solve the problem.
     
    adyh, Aug 17, 2007
    #8
  9. Mark Olbert

    d.mohana

    Joined:
    Dec 24, 2007
    Messages:
    1
    Location:
    Bangalore
    I am also having __doPostback problem in mozilla.
    Trying to invoke __doPostBack from popup page using window.opener.__doPostBack("ControlID", ''), but the parent page is not rendrering properly i.e its not displaying latest date, if refresh the page then it will show updated data. Entire thing is working fine in IE, please help me out to make this to work in mozilla.
     
    d.mohana, Dec 24, 2007
    #9
  10. Mark Olbert

    Chris Date

    Joined:
    Oct 30, 2009
    Messages:
    1
    I´ve got the same Problem...
    Having a WeekPlanner.aspx and this open a PopUp Window ( DatePicker.aspx ) but after picking a Date in the asp:Calendar ( changeDate Event ) the window doesnt close and doesnt DoPostBack in FireFox...
    IE works fine!
     
    Chris Date, Oct 30, 2009
    #10
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Timothy Kelley

    calling doPostBack not working

    Timothy Kelley, Jul 18, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    773
  2. Rob Meade

    LinkButton / doPostBack problem

    Rob Meade, Aug 25, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    4,097
    Raterus
    Aug 25, 2004
  3. Zuel
    Replies:
    4
    Views:
    2,194
  4. Sathyaish
    Replies:
    3
    Views:
    3,169
    Sathyaish
    Sep 8, 2005
  5. Sathyaish

    Linkbutton does not look like a linkbutton

    Sathyaish, Sep 8, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    217
    Sathyaish
    Sep 8, 2005
Loading...

Share This Page