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. Diable the Refresh button !

Diable the Refresh button !

Scheduled Pinned Locked Moved ASP.NET
javascripthelp
4 Posts 4 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.
  • J Offline
    J Offline
    Jacobb Michael
    wrote on last edited by
    #1

    Hi all i want to disable the Refresh button i just addeded javascript function for F5. and it works fine here is my code works fine for F5

    "function refresh()"+
    "{"+

                            "if (116==event.keyCode)"+
                            "{"+
                                "event.cancelBubble = true;" +
                                "event.returnValue = false;" +
                                "event.keyCode = 0;" +
                                "return false;" +
                             "}"+
                             
                        "}"+
                        "document.onkeydown = function (){ refresh(); } ");
    

    but i cant diable the icon shown in tool bar for Refresh can some one help me thanks in advance

    S K A 3 Replies Last reply
    0
    • J Jacobb Michael

      Hi all i want to disable the Refresh button i just addeded javascript function for F5. and it works fine here is my code works fine for F5

      "function refresh()"+
      "{"+

                              "if (116==event.keyCode)"+
                              "{"+
                                  "event.cancelBubble = true;" +
                                  "event.returnValue = false;" +
                                  "event.keyCode = 0;" +
                                  "return false;" +
                               "}"+
                               
                          "}"+
                          "document.onkeydown = function (){ refresh(); } ");
      

      but i cant diable the icon shown in tool bar for Refresh can some one help me thanks in advance

      S Offline
      S Offline
      sashidhar
      wrote on last edited by
      #2

      Try This..!

      <Script language="javascript">
      function checkKeyCode(evt)
      {

      var evt = (evt) ? evt : ((event) ? event : null);
      var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);
      if(event.keyCode==116)
      {
      evt.keyCode=0;
      return false
      }
      }
      document.onkeydown=checkKeyCode;
      </script>

      LatestArticle :Log4Net Why Do Some People Forget To Mark as Answer .If It Helps.

      1 Reply Last reply
      0
      • J Jacobb Michael

        Hi all i want to disable the Refresh button i just addeded javascript function for F5. and it works fine here is my code works fine for F5

        "function refresh()"+
        "{"+

                                "if (116==event.keyCode)"+
                                "{"+
                                    "event.cancelBubble = true;" +
                                    "event.returnValue = false;" +
                                    "event.keyCode = 0;" +
                                    "return false;" +
                                 "}"+
                                 
                            "}"+
                            "document.onkeydown = function (){ refresh(); } ");
        

        but i cant diable the icon shown in tool bar for Refresh can some one help me thanks in advance

        K Offline
        K Offline
        Kannan Ar
        wrote on last edited by
        #3

        Controlling browser buttons is an idiotic idea. Actually you cant do it with 100% perfection.

        1 Reply Last reply
        0
        • J Jacobb Michael

          Hi all i want to disable the Refresh button i just addeded javascript function for F5. and it works fine here is my code works fine for F5

          "function refresh()"+
          "{"+

                                  "if (116==event.keyCode)"+
                                  "{"+
                                      "event.cancelBubble = true;" +
                                      "event.returnValue = false;" +
                                      "event.keyCode = 0;" +
                                      "return false;" +
                                   "}"+
                                   
                              "}"+
                              "document.onkeydown = function (){ refresh(); } ");
          

          but i cant diable the icon shown in tool bar for Refresh can some one help me thanks in advance

          A Offline
          A Offline
          Abhishek Sur
          wrote on last edited by
          #4

          jasome wrote:

          but i cant diable the icon shown in tool bar for Refresh

          Actually you can't. Only thing that you can do(what most banking site does) is you can open this in a new window with no toolbar. Thus the Refresh button never appears. And you just remove the refresh facility from browser and you are done. You should also remove the Right click context menu. You might look into this to disable right click in browser: http://www.codeproject.com/tips/42554/Javascript-hack-to-disable-Right-Click-and-Text-Se.aspx[^] Cheers :rose:

          Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.


          My Latest Articles-->** Simplify Code Using NDepend
          Basics of Bing Search API using .NET
          Microsoft Bing MAP using Javascript

          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