stop button postback ajax in non-ie

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • gerry

    stop button postback ajax in non-ie

    Sung the ASP.NET AJAX framework, and following the control creation examples
    from the ajax toolkit I have created a simple custom control that includes a
    button with a client side onClick handler.
    Returning false from the handler prevents postbacks in IE but in firefox the
    handler fires and does its thing but the postback still occurs as well.
    I read that changing this from an INPUT SUMIT to a BUTTON would fix this
    problem, however that to me is a problem as it always prevents postbacks. I
    would still want postbacks to occur in the case where scripting is turned
    off or not supported.

    If I add an asp:Button to the page and set the
    OnClientClick=" alert('hi');ret urn false;" the postback is suppressed in all
    browsers as it should be - so I assume that the problem is buried somewhere
    in the ajax framework.

    Any suggestions ?

    Gerry


  • Walter Wang [MSFT]

    #2
    RE: stop button postback ajax in non-ie

    Hi Gerry,

    I'm not very sure about your question, is it related to AJAX Control
    Toolkit or you're just creating a simple ScriptControl?

    Could you please post the complete code that could help to reproduce the
    issue? Also, what's the version of Firefox you're using?

    Thanks for the effort.


    Regards,
    Walter Wang (wawang@online. microsoft.com, remove 'online.')
    Microsoft Online Community Support

    =============== =============== =============== =====
    When responding to posts, please "Reply to Group" via your newsreader so
    that others may learn and benefit from your issue.
    =============== =============== =============== =====

    This posting is provided "AS IS" with no warranties, and confers no rights.

    Comment

    • gerry

      #3
      Re: stop button postback ajax in non-ie

      Hi Walter,

      I am creating a "Custom ASP.NET AJAX Client Controls" based on examples in
      the Ajax Control Toolkit.

      I foundthe solution : rather than returning false from the event handler , I
      called event.preventDe fault();
      _onButtonClick : function( e ) {
      alert("Click Handler.");
      e.preventDefaul t();
      }


      Gerry



      ""Walter Wang [MSFT]"" <wawang@online. microsoft.comwr ote in message
      news:3ejsKQPLIH A.6908@TK2MSFTN GHUB02.phx.gbl. ..
      Hi Gerry,
      >
      I'm not very sure about your question, is it related to AJAX Control
      Toolkit or you're just creating a simple ScriptControl?
      >
      Could you please post the complete code that could help to reproduce the
      issue? Also, what's the version of Firefox you're using?
      >
      Thanks for the effort.
      >
      >
      Regards,
      Walter Wang (wawang@online. microsoft.com, remove 'online.')
      Microsoft Online Community Support
      >
      =============== =============== =============== =====
      When responding to posts, please "Reply to Group" via your newsreader so
      that others may learn and benefit from your issue.
      =============== =============== =============== =====
      >
      This posting is provided "AS IS" with no warranties, and confers no
      rights.
      >

      Comment

      • Walter Wang [MSFT]

        #4
        Re: stop button postback ajax in non-ie

        Hi Gerry,

        Thanks for sharing your solution here. Please feel free to let me know if
        there's anything else I can help.


        Regards,
        Walter Wang (wawang@online. microsoft.com, remove 'online.')
        Microsoft Online Community Support

        =============== =============== =============== =====
        When responding to posts, please "Reply to Group" via your newsreader so
        that others may learn and benefit from your issue.
        =============== =============== =============== =====

        This posting is provided "AS IS" with no warranties, and confers no rights.

        Comment

        Working...