Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: ASP.NET
hi all,
I have an image control in my aspx page.
here right clicking on the image i want to increment variable value in code behind. that is in aspx.cs.
how can i achieve this functionality.

Posted 30-Dec-12 19:37pm
Sergey Alexandrovich Kryukov at 31-Dec-12 1:42am
What did you try?

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

You can register some JavaScript handling the click. As you need to handle the even on the server side (but are you sure? maybe handling it on the client side using JavaScript is better?), you would need to use Ajax to send an HTTP request to the server side. As you need a right, not left mouse click, you may want to use just the event onmouseup.
Please see:[^],[^].
On Ajax:[^],[^],[^].
However, I would rather advise using jQuery for both purposes. Please see:[^],[^],[^],[^].
If you need to learn jQuery, start here:[^],[^].
Good luck,
ridoy at 31-Dec-12 3:48am
Sergey Alexandrovich Kryukov at 31-Dec-12 11:50am
Thank you very much,

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 390
1 Nirav Prabtani 273
2 _Amy 255
3 Richard Deeming 250
4 CHill60 195
0 _Amy 110
1 Maciej Los 90
2 OriginalGriff 85
3 Mehdi Gholam 80
4 Sergey Alexandrovich Kryukov 75

Advertise | Privacy | Mobile
Web03 | 2.8.140721.1 | Last Updated 31 Dec 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100