Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Kresten Banke 36 posts 56 karma points
    Apr 19, 2010 @ 18:13
    Kresten Banke
    0

    Problem with postback in Firefox with asp.net controls

     

    <!-- /* Font Definitions */ @font-face {font-family:Times; panose-1:2 0 5 0 0 0 0 0 0 0; mso-font-charset:0; mso-generic-font-family:auto; mso-font-pitch:variable; mso-font-signature:3 0 0 0 1 0;} @font-face {font-family:Cambria; panose-1:2 4 5 3 5 4 6 3 2 4; mso-font-charset:0; mso-generic-font-family:auto; mso-font-pitch:variable; mso-font-signature:3 0 0 0 1 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0cm; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; mso-ascii-font-family:Cambria; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:Cambria; mso-fareast-theme-font:minor-latin; mso-hansi-font-family:Cambria; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi; mso-fareast-language:EN-US;} p {margin:0cm; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ascii-font-family:Times; mso-fareast-font-family:Cambria; mso-fareast-theme-font:minor-latin; mso-hansi-font-family:Times; mso-bidi-font-family:"Times New Roman";} @page Section1 {size:612.0pt 792.0pt; margin:3.0cm 2.0cm 3.0cm 2.0cm; mso-header-margin:35.4pt; mso-footer-margin:35.4pt; mso-paper-source:0;} div.Section1 {page:Section1;} -->

    Hi forum,

    On my umbraco site I use standard various asp.net controls such as checkboxes, calendar controls, and hyperlink controls etc.

    They all work flawlessly in IE 6&7 and in Safari. However, in Firefox both on Mac and PC, nothing happens when the control is supposed to do a postback.

     

    How do I solve this issue? Is it an Umbraco thing, or what?

    Hope that you can help, or at least clarify...

    Kind regards

    -Kresten

  • Kresten Banke 36 posts 56 karma points
    Apr 19, 2010 @ 18:14
    Kresten Banke
    0

    Wow - let's try again:

    - - - - - - - - - -

    Hi forum,

    On my umbraco site I use standard various asp.net controls such as checkboxes, calendar controls, and hyperlink controls etc.

    They all work flawlessly in IE 6&7 and in Safari. However, in Firefox both on Mac and PC, nothing happens when the control is supposed to do a postback.

     

    How do I solve this issue? Is it an Umbraco thing, or what?

    Hope that you can help, or at least clarify...

    Kind regards

    -Kresten

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Apr 19, 2010 @ 18:26
    Jan Skovgaard
    0

    Hi Kresten

    Can you perhaps show us some of the code?

    /Jan

  • Morten Bock 1867 posts 2140 karma points MVP 2x admin c-trib
    Apr 19, 2010 @ 20:08
    Morten Bock
    0

    Is javascript by any chance disabled in the Firefox browser, or do you get any javascript errors?

  • Kresten Banke 36 posts 56 karma points
    Apr 20, 2010 @ 19:46
    Kresten Banke
    0

    Javascript is enabled - it doesn't work in any of the FF browser I have tested on (about 5-6 different - PCs and Macs).

    In the source code the following is inserted somewhere. I don't know where it is inserted, but it must be something umbraco writes, since I haven't written it and I can't find "theForm" anywhere... Could this be why it doesn't work in FF?

    Source code:

    <script type="text/javascript">
    //<![CDATA[
    var 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();
    }
    }
    //]]>
    </script>
  • Richard Soeteman 4035 posts 12842 karma points MVP
    Apr 20, 2010 @ 20:20
    Richard Soeteman
    0

    This is the part ASP.net renders for you, nothing Umbraco related, Please check if you don't have multiple forms on your page. ASP.NET only works with 1 form.

    Cheers,

    Richard 

  • Kresten Banke 36 posts 56 karma points
    Apr 20, 2010 @ 20:53
    Kresten Banke
    0

    But if I have more than more form, would't I get an error? It works in IE and Safari. In my masterpage I have a form, other than that I haven't got any forms...

  • Richard Soeteman 4035 posts 12842 karma points MVP
    Apr 20, 2010 @ 21:18
    Richard Soeteman
    0

    You only get an error when you have two forms with the runat=server attribute. Multiple forms on an asp.net page can cause strange issues.

    Cheers,

    Richard

  • Kresten Banke 36 posts 56 karma points
    Apr 20, 2010 @ 22:02
    Kresten Banke
    0

    Ok - thanks for clarifying. I have one form in my MasterPage. If I remove that, the postback doesn't work in IE either.

    Is there anything else, I can be doing wrong?

    -Kresten

  • Bart van der Werf 5 posts 25 karma points
    Apr 20, 2010 @ 22:25
    Bart van der Werf
    0

    Hi Kersten. What do you mean that nothing happens? Is there no postback? Are you using an updatepanel perhaps and missing a visual cue? Did you verify with Fiddler that there is no postback? Does your control use autopostback="true" ?

    Regards, Bart

  • Kresten Banke 36 posts 56 karma points
    Apr 20, 2010 @ 23:16
    Kresten Banke
    0

    Hi Bart,

    I use a standard asp.net control. I use set autopostback="true" on for instance the Calendar control. I don't use an updatepanel (at least I don't think so!).

    Here is an example: http://www.yellowfee.dk/kontakt.aspx the "Sign-in" link is an asp hyperlink. I works in IE and safari where it lets the user go to the log-in page, but in FF nothing happens when clicking the link...

    ?

  • Kresten Banke 36 posts 56 karma points
    Apr 20, 2010 @ 23:22
    Kresten Banke
    0

    Sorry - the control is actually an asp LoginStatus control - however behavior is the same on dropdowns, calendar controls etc. when trying to do an autopostback.

  • Morten Bock 1867 posts 2140 karma points MVP 2x admin c-trib
    Apr 21, 2010 @ 09:56
    Morten Bock
    0

    Kresten, you have your form tag ouside the html tags like this:

    <form>
        <html>
            <head></head>
            <body></body>
        </html>
    </form>

    You need to put your form inside the body tag:

    <html>
        <head></head>
        <body>
            <form>content here...</form>
        </body>
    </html>
    

  • Bart van der Werf 5 posts 25 karma points
    Apr 21, 2010 @ 09:58
    Bart van der Werf
    0

    Hi Kresten. Perhaps you can try setting the navigateURL attribute of the hyperlink to simply login.aspx? Does that work?

    Grtz, Bart

  • Bart van der Werf 5 posts 25 karma points
    Apr 21, 2010 @ 09:59
    Bart van der Werf
    0

    Hi Kresten. Perhaps you can try setting the value of navigateURL in the hyperlink control to simply login.aspx? Does that work?

    Regards, Bart

  • Ismail Mayat 4511 posts 10091 karma points MVP 2x admin c-trib
    Apr 21, 2010 @ 10:42
    Ismail Mayat
    0

    Kresten,

    The only time i have had postback problems in firefox is when using imagebutton control and not supplying image for the button or incorrect url for the image. In those instances i have found the page does not post back.  Can you take a look if in firefox you are getting any javascript errors.

    Regards

     

    Ismail

  • Kresten Banke 36 posts 56 karma points
    Apr 21, 2010 @ 12:12
    Kresten Banke
    0

    Yehaaa! The Form-thing worked - Thank you Morten. Now the asp dropdowns, checkboxes and links work perfectly!

    I still don't get any autopostback from my imagebuttons, I'll investigate if I use a wrong url for the image as you describe Ismail... Is there anything that I should pay attention to? Currently I'm just using the imagebutton property-window-thing to reference an image in my /Images folder in my project. On the server I have the same image in my /Images folder on the server.

    Kind regards

    -Kresten

     

  • Ismail Mayat 4511 posts 10091 karma points MVP 2x admin c-trib
    Apr 21, 2010 @ 15:36
    Ismail Mayat
    0

    Kresten,

    Make sure you can see an image.  if the url is wrong or you don't have permissiosn to view the image then imagebutton will not work in firefox.

    Regards

    Ismail

Please Sign in or register to post replies

Write your reply to:

Draft