How to trap Right mouse in an ASP

Results 1 to 3 of 3

Thread: How to trap Right mouse in an ASP

  1. #1
    Vibhu Guest

    Default How to trap Right mouse in an ASP

    Hi,<BR> I have the following two issues with ASPs:<BR><BR> 1. How do I trap a right-mouse click on a button in an ASP Page ? In other words, how do i tell if a user did a right click or left click ?<BR> 2. I am trying to use an OCX control in an ASP Page. This ctrl. connects to a RPC Server console app(written in VC++). If I embed the ctrl. in an ASP Page and call the Connect method of the control, the OCX connects to the RPC Server, but once i navigate to another URL, the connection is lost. I suspect that this is due to to the fact that the OCX has lost its scope. Alternatively, I tried to do the same entirely with Server-Side script. I did a Server.CreateObject() of the OCX and in design-time, the properties and methods of the OCX are displayed(in Visual Interdev), but when I execute the page in IE 4.0, I am unable to call the methods of the OCX - not even an AboutBox method ! The browser shows "Web site found. Waiting for reply.." in the status bar for a VERY LONG time and then reports a timeout. <BR> These are the two issues I face. Could someone please help ? Reply to<BR>Regards<BR>Vibhu

  2. #2
    Mike Kercheval Guest

    Default RE: Question #1. How to trap Right mouse in an ASP

    Answer to 1st question: How to trap Right mouse in an ASP<BR>Really the mouse click is trapped in the browser and information is sent back to the next ASP page.<BR>1. trap keystroke in Dhtml methods (onkeypress), client side object or applet, or use two buttons/areas for older browsers. <BR>2. set a hidden &#060;input&#062; to right click or left click<BR>3. send the form with submit method to second asp page<BR>4. strip out click info with request.form<BR>That method works for ie3 Netscape 2 and above. If you can limit the browser to DHTML it&#039s much easier. you can also send the info on the url in a hidden frame.<BR><BR>Leave message if you want example code. specify browser range.

  3. #3
    Sathiya Guest

    Default Q1. How to trap Right mouse in an ASP

    from some site<BR><BR>&#060;script language="JavaScript1.2"&#062;<BR>if (document.all){<BR>document.body.onmousedown=new Function("if (event.button==2&#124&#124event.button==3)alert(&# 039The right mouse button has been disabled&#039)");<BR>}<BR>&#060;/script&#062;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts