locked
Regarding Mouse right click and back button block in C# RRS feed

  • Question

  • Hello,

              I want to know how do I write the code for blocking the mouse right click and back button block in C# Code. Are there any namespaces to do such operations (Server side - .cs implementation) . Moreover the java script solution is not of any use , because java script can be bypassed and hence the required functionality.

    Thanks

    Anoop

    • Moved by CoolDadTx Monday, August 17, 2015 3:05 PM Wrong forums
    Monday, August 17, 2015 8:10 AM

Answers

  • Questions related to web applications should be posted in the ASP.NET forums (http://forums.asp.net ).
    • Proposed as answer by Just Karl Tuesday, August 18, 2015 4:31 PM
    • Marked as answer by Just Karl Friday, August 28, 2015 5:20 PM
    Monday, August 17, 2015 3:05 PM
  • On top of what he said, stop doing that.

    Back button and rightclick are entirely client side opeartions. You are out of your place to interfere in them.
    About the only way would be some java script - and that could just be not run, ignored or overridden.

    If you are making a dynamic webpage it would be possible to verify if the page request follows the proper path via the session state variable. If the operation is currently in state "Fill Formular 4", all request for formulars 1-3 and 5-6 will properly fail.
    But ideally your web application should be designed to not have issues with that to begin with!

    Or is this about changing the behavior of a Webbrowser controll in a Windows Forms/WPF Browser element?

    • Edited by Christopher84 Monday, August 17, 2015 5:46 PM
    • Proposed as answer by Just Karl Tuesday, August 18, 2015 4:31 PM
    • Marked as answer by Just Karl Friday, August 28, 2015 5:20 PM
    Monday, August 17, 2015 5:45 PM

All replies

  • Questions related to web applications should be posted in the ASP.NET forums (http://forums.asp.net ).
    • Proposed as answer by Just Karl Tuesday, August 18, 2015 4:31 PM
    • Marked as answer by Just Karl Friday, August 28, 2015 5:20 PM
    Monday, August 17, 2015 3:05 PM
  • On top of what he said, stop doing that.

    Back button and rightclick are entirely client side opeartions. You are out of your place to interfere in them.
    About the only way would be some java script - and that could just be not run, ignored or overridden.

    If you are making a dynamic webpage it would be possible to verify if the page request follows the proper path via the session state variable. If the operation is currently in state "Fill Formular 4", all request for formulars 1-3 and 5-6 will properly fail.
    But ideally your web application should be designed to not have issues with that to begin with!

    Or is this about changing the behavior of a Webbrowser controll in a Windows Forms/WPF Browser element?

    • Edited by Christopher84 Monday, August 17, 2015 5:46 PM
    • Proposed as answer by Just Karl Tuesday, August 18, 2015 4:31 PM
    • Marked as answer by Just Karl Friday, August 28, 2015 5:20 PM
    Monday, August 17, 2015 5:45 PM