Handle Double-click on <Input type="image">

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?V2lsbA==?=

    Handle Double-click on <Input type="image">

    I have an image "button" which causes a postback.

    I handle the "click" with

    If Request.Form("b tnBU7WD6_Submit .X") 0 Then...

    this works great. However, when a user double-clicks the image button the
    Page_Load (postback) is processed twice. This is a problem.

    Is there any easy way to detect that the image button has been double-cliked
    and posted back twice?

    --
    -Will
  • =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=

    #2
    RE: Handle Double-click on &lt;Input type=&quot;imag e&quot;&gt;

    Try creating a boolean Session Item at thee end of the click handler method
    , and check for its presence before handling any subsequent clicks. If the
    session item is not null at the beginning of the click handler method body,
    that means it was already clicked.
    -- Peter
    Site: http://www.eggheadcafe.com
    UnBlog: http://petesbloggerama.blogspot.com
    Short Urls & more: http://ittyurl.net


    "Will" wrote:
    I have an image "button" which causes a postback.
    >
    I handle the "click" with
    >
    If Request.Form("b tnBU7WD6_Submit .X") 0 Then...
    >
    this works great. However, when a user double-clicks the image button the
    Page_Load (postback) is processed twice. This is a problem.
    >
    Is there any easy way to detect that the image button has been double-cliked
    and posted back twice?
    >
    --
    -Will

    Comment

    • =?Utf-8?B?V2lsbA==?=

      #3
      RE: Handle Double-click on &lt;Input type=&quot;imag e&quot;&gt;

      Thanks Peter. That's the solution I planned on going with.

      I was hoping there was a way to detect it in the Postback, but I don't see
      anything.

      Thanks
      --
      -Will


      "Peter Bromberg [C# MVP]" wrote:
      Try creating a boolean Session Item at thee end of the click handler method
      , and check for its presence before handling any subsequent clicks. If the
      session item is not null at the beginning of the click handler method body,
      that means it was already clicked.
      -- Peter
      Site: http://www.eggheadcafe.com
      UnBlog: http://petesbloggerama.blogspot.com
      Short Urls & more: http://ittyurl.net
      >
      >
      "Will" wrote:
      >
      I have an image "button" which causes a postback.

      I handle the "click" with

      If Request.Form("b tnBU7WD6_Submit .X") 0 Then...

      this works great. However, when a user double-clicks the image button the
      Page_Load (postback) is processed twice. This is a problem.

      Is there any easy way to detect that the image button has been double-cliked
      and posted back twice?

      --
      -Will

      Comment

      • Jeff Dillon

        #4
        Re: Handle Double-click on &lt;Input type=&quot;imag e&quot;&gt;

        Disable the button client side onclick?

        "Will" <Will@discussio ns.microsoft.co mwrote in message
        news:057D32B3-66DE-4B2F-BCEA-81AFD264DD58@mi crosoft.com...
        Thanks Peter. That's the solution I planned on going with.
        >
        I was hoping there was a way to detect it in the Postback, but I don't see
        anything.
        >
        Thanks
        --
        -Will
        >
        >
        "Peter Bromberg [C# MVP]" wrote:
        >
        >Try creating a boolean Session Item at thee end of the click handler
        >method
        >, and check for its presence before handling any subsequent clicks. If
        >the
        >session item is not null at the beginning of the click handler method
        >body,
        >that means it was already clicked.
        >-- Peter
        >Site: http://www.eggheadcafe.com
        >UnBlog: http://petesbloggerama.blogspot.com
        >Short Urls & more: http://ittyurl.net
        >>
        >>
        >"Will" wrote:
        >>
        I have an image "button" which causes a postback.
        >
        I handle the "click" with
        >
        If Request.Form("b tnBU7WD6_Submit .X") 0 Then...
        >
        this works great. However, when a user double-clicks the image button
        the
        Page_Load (postback) is processed twice. This is a problem.
        >
        Is there any easy way to detect that the image button has been
        double-cliked
        and posted back twice?
        >
        --
        -Will

        Comment

        Working...