Click here to Skip to main content
12,765,284 members (37,853 online)
Rate this:
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 20:37pm
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 31-Dec-12 3:48am
Sergey Alexandrovich Kryukov 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
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170217.1 | Last Updated 31 Dec 2012
Copyright © CodeProject, 1999-2017
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