468,765 Members | 1,296 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,765 developers. It's quick & easy.

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

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

I handle the "click" with

If Request.Form("btnBU7WD6_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
Mar 13 '08 #1
3 2091
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("btnBU7WD6_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
Mar 13 '08 #2
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("btnBU7WD6_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
Mar 13 '08 #3
Disable the button client side onclick?

"Will" <Wi**@discussions.microsoft.comwrote in message
news:05**********************************@microsof t.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("btnBU7WD6_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

Mar 13 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Tor Inge Rislaa | last post: by
3 posts views Thread by C Glenn | last post: by
4 posts views Thread by _DD | last post: by
3 posts views Thread by | last post: by
1 post views Thread by =?Utf-8?B?R2lkaQ==?= | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by Marin | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.