views:

34

answers:

1

hi my dear friends :

How can i Simulate Left And Right Mouse Click In Asp.net Web Applications ?

i found a thread about this issue for win applications but not work on web app...

in right mouse simulation i want to see menu bar...

thanks in advance

+2  A: 

You can simulate the results of a left mouse click programatically on the server side by raising the Clicked event of the control you want to simulate the click on.

Right-clicks in and of themselves are not sent to the server via postback. They are handled purely within the confines of the browser, and though actions can be tied to a right-click via JavaScript, such code is, for very good reason, not accessible programatically from outside the browser. Similarly, OnClick JavaScript events can be invoked only through user action (either directly clicking on that button or by calling the same method based on some other user action).

If you want to simulate a user experience for testing, I'd look into a UI automation setup like Selenium or iMacro.

KeithS