aspx Tutorial

NET Articles,jQuery demo, with jQuery, online tutorial,Jquery, SilverLight, Javascript,,JSON, MVC,.NET Articles,demo, Web Services,
Advertise Here


Get our toolbar!


Posted by Aamir Hasan   on Friday, September 7, 2012 Total Views:  

In this example, you will see how to disable right click on HTML div. To prevent user by right click on HTML div, we can disable right on HTML div by using oncontextmenu event provide to disable right click.


<!DOCTYPE html>


<head runat="server">

    <title>Disable right click on HTML div</title>


        html, body


            font-family: Arial;

            font-size: 90%;

            color: #888;

            line-height: 1.5em;

            background-color: #FFF5FF;





            border: 1pxsolid#aaa;

            display: block;

            width: 200px;

            height: 100px;

            padding: 10px;

            background-color: #FFFFCF;

            margin: 10px;





    <form id="form1" runat="server">

        <div class="secret" oncontextmenu="return false;">Your ASP.NET Control</div>

        <div class="secret" oncontextmenu="return false;">


                <asp:HyperLink ID="HyperLink1" NavigateUrl=""

                    runat="server" Target="_blank">jquery with</asp:HyperLink>

                <asp:HyperLink ID="HyperLink2" NavigateUrl=""

                    runat="server" Target="_blank"> examples</asp:HyperLink>










Disable-Right-ClickonControl.aspx (888.00 bytes)


 See live demo

Protected by Copyscape Online Plagiarism Tool

Comments (4) -

Joe United States
9/7/2012 8:56:07 AM #


soccer shoes
soccer shoes United States
5/26/2013 6:29:05 PM #

<a href="">Adidas Soccer Cleats</a>

soccer shoes
soccer shoes United States
5/26/2013 6:29:24 PM #

<a href="">AdiPURE IV TRX</a>

soccer shoes
soccer shoes Slovenia
7/17/2013 11:34:47 PM #

Cheap wholesale nfl jerseys
Cheap wholesale nfl jerseys United States
9/5/2015 11:31:17 PM #

<a href="">nike nfl jerseys wholesale</a>

Add comment

  Country flag

  • Comment
  • Preview

Advertizement 1
Advertizement 2
Advertizement 3
Advertizement 4
Advertizement 5