Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Protect a webpage

Protect a webpage

Scheduled Pinned Locked Moved ASP.NET
csharpjavascriptasp-net
8 Posts 8 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    rowdykuttan
    wrote on last edited by
    #1

    Dear all I am developing a website for a client in ASP.NET, Client wants to protect his webpages from copied. He asked me the following 1) Stop right click 2) Stop Context menu 3) Stop user saving and viewing source using "Save Page As" and "Page Source" in firefox. "Save As" and "view source" in internet explorer. 4) Stop taking print screen and saving it as image In this i have accomplised the tasks 1 & 2 using javascript. is there any way to do the 3 & 4 tasks. If not possible please drop me the exact reason so i can make the client understand. Thanks in advance Regards sc

    D S G P T 7 Replies Last reply
    0
    • R rowdykuttan

      Dear all I am developing a website for a client in ASP.NET, Client wants to protect his webpages from copied. He asked me the following 1) Stop right click 2) Stop Context menu 3) Stop user saving and viewing source using "Save Page As" and "Page Source" in firefox. "Save As" and "view source" in internet explorer. 4) Stop taking print screen and saving it as image In this i have accomplised the tasks 1 & 2 using javascript. is there any way to do the 3 & 4 tasks. If not possible please drop me the exact reason so i can make the client understand. Thanks in advance Regards sc

      D Offline
      D Offline
      DevCubed
      wrote on last edited by
      #2

      I doubt 3 and 4 can be accomplished -- at least not in every browser. And there is no way to completely protect the XHTML/CSS/JavaScript source (your serverside code is safe though, unless the server itself is compromised). If someone has the will and know-how to get it, they will.

      1 Reply Last reply
      0
      • R rowdykuttan

        Dear all I am developing a website for a client in ASP.NET, Client wants to protect his webpages from copied. He asked me the following 1) Stop right click 2) Stop Context menu 3) Stop user saving and viewing source using "Save Page As" and "Page Source" in firefox. "Save As" and "view source" in internet explorer. 4) Stop taking print screen and saving it as image In this i have accomplised the tasks 1 & 2 using javascript. is there any way to do the 3 & 4 tasks. If not possible please drop me the exact reason so i can make the client understand. Thanks in advance Regards sc

        S Offline
        S Offline
        Sundar_R
        wrote on last edited by
        #3

        You can disable the menubars and tool bars using opendialog method. If i were you, i would create a new startup page and use opendialog to launch the home page diabling the menu and tool bars.

        1 Reply Last reply
        0
        • R rowdykuttan

          Dear all I am developing a website for a client in ASP.NET, Client wants to protect his webpages from copied. He asked me the following 1) Stop right click 2) Stop Context menu 3) Stop user saving and viewing source using "Save Page As" and "Page Source" in firefox. "Save As" and "view source" in internet explorer. 4) Stop taking print screen and saving it as image In this i have accomplised the tasks 1 & 2 using javascript. is there any way to do the 3 & 4 tasks. If not possible please drop me the exact reason so i can make the client understand. Thanks in advance Regards sc

          G Offline
          G Offline
          Guffa
          wrote on last edited by
          #4

          rowdykuttan wrote:

          In this i have accomplised the tasks 1 & 2 using javascript.

          And anyone can easily disable Javascript in the browser to undo that.

          rowdykuttan wrote:

          is there any way to do the 3 & 4 tasks.

          You might be able to accomplish part of task 3, but than can also easily be undone by simply requesting the page using some other program than the browser. All that is needed is a single line of code:

          new WebClient().DownloadFile(url, fileName);

          Anything that the browser can read can also be read by other programs, so there is no way that you can keep anyone from reading anything that you want to show on the web. Task 4 is not possible at all using Javascript, as it's not a function in the browser, it's a function in the operating system.

          Despite everything, the person most likely to be fooling you next is yourself.

          1 Reply Last reply
          0
          • R rowdykuttan

            Dear all I am developing a website for a client in ASP.NET, Client wants to protect his webpages from copied. He asked me the following 1) Stop right click 2) Stop Context menu 3) Stop user saving and viewing source using "Save Page As" and "Page Source" in firefox. "Save As" and "view source" in internet explorer. 4) Stop taking print screen and saving it as image In this i have accomplised the tasks 1 & 2 using javascript. is there any way to do the 3 & 4 tasks. If not possible please drop me the exact reason so i can make the client understand. Thanks in advance Regards sc

            P Offline
            P Offline
            Perspx
            wrote on last edited by
            #5

            There is no way of preventing a web page being copied. The idea is that the source is easily accessible and trying to prevent the user from doing this won't really do anything, since the nature of the Internet is such that files that can be viewed in a web browser can be accessed by anyone. Regards, --Perspx

            "A refund for defective software might be nice, except it would bankrupt the entire software industry in the first year."
            -Andrew Tanenbaum
            "Einstein argued that there must be simplified explanations of nature, because God is not capricious or arbitrary. No such faith comforts the software engineer."
            -Fred Brooks

            1 Reply Last reply
            0
            • R rowdykuttan

              Dear all I am developing a website for a client in ASP.NET, Client wants to protect his webpages from copied. He asked me the following 1) Stop right click 2) Stop Context menu 3) Stop user saving and viewing source using "Save Page As" and "Page Source" in firefox. "Save As" and "view source" in internet explorer. 4) Stop taking print screen and saving it as image In this i have accomplised the tasks 1 & 2 using javascript. is there any way to do the 3 & 4 tasks. If not possible please drop me the exact reason so i can make the client understand. Thanks in advance Regards sc

              T Offline
              T Offline
              Todd Smith
              wrote on last edited by
              #6

              The simple answer is You can't.

              Todd Smith

              1 Reply Last reply
              0
              • R rowdykuttan

                Dear all I am developing a website for a client in ASP.NET, Client wants to protect his webpages from copied. He asked me the following 1) Stop right click 2) Stop Context menu 3) Stop user saving and viewing source using "Save Page As" and "Page Source" in firefox. "Save As" and "view source" in internet explorer. 4) Stop taking print screen and saving it as image In this i have accomplised the tasks 1 & 2 using javascript. is there any way to do the 3 & 4 tasks. If not possible please drop me the exact reason so i can make the client understand. Thanks in advance Regards sc

                C Offline
                C Offline
                Christian Graus
                wrote on last edited by
                #7

                You think you've accomplished one and two. I guarentee you that I can get around it if I wanted to. I suggest you shouldn't be taking clients if you can't answer their questions.

                Christian Graus Driven to the arms of OSX by Vista.

                1 Reply Last reply
                0
                • R rowdykuttan

                  Dear all I am developing a website for a client in ASP.NET, Client wants to protect his webpages from copied. He asked me the following 1) Stop right click 2) Stop Context menu 3) Stop user saving and viewing source using "Save Page As" and "Page Source" in firefox. "Save As" and "view source" in internet explorer. 4) Stop taking print screen and saving it as image In this i have accomplised the tasks 1 & 2 using javascript. is there any way to do the 3 & 4 tasks. If not possible please drop me the exact reason so i can make the client understand. Thanks in advance Regards sc

                  R Offline
                  R Offline
                  Rajdev Ramasamy
                  wrote on last edited by
                  #8

                  Hi, The following sample will help you out for the points 1 and 4 for sure. Please try this and reply.

                  <html>
                  <head>
                  </head>

                  <!-- To disable Print Screen feature -->
                  <body onload=setInterval("window.clipboardData.setData('text','')",2) oncontextmenu="return false" onselectstart="return false">
                  Test Text
                  <!-- To disable right click in the web page -->

                  <script language=JavaScript>
                  function clickIE() {
                  if (document.all) {
                  return false;
                  }
                  }
                  function clickNS(e) {
                  if (document.layers||(document.getElementById&&!document.all)) {
                  if (e.which==2||e.which==3) {
                  return false;
                  }
                  }
                  }
                  if (document.layers) {
                  document.captureEvents(Event.MOUSEDOWN);
                  document.onmousedown=clickNS;
                  }
                  else{
                  document.onmouseup=clickNS;
                  document.oncontextmenu=clickIE;
                  }
                  document.oncontextmenu=new Function("return false")
                  </script>

                  <!-- To Disable Text Selection -->

                  <script>

                  function disableselect(e){
                  return false
                  }

                  function reEnable(){
                  return true
                  }

                  //if IE4+
                  document.onselectstart=new Function ("return false")

                  //if NS6
                  if (window.sidebar){
                  document.onmousedown=disableselect
                  document.onclick=reEnable
                  }
                  </script>

                  </html>

                  Thanks, Rajdev K R

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups