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. General Programming
  3. Windows Forms
  4. enable/disable auto refresh of a web browser control from Win forms?

enable/disable auto refresh of a web browser control from Win forms?

Scheduled Pinned Locked Moved Windows Forms
question
4 Posts 2 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.
  • U Offline
    U Offline
    User 3362983
    wrote on last edited by
    #1

    I have a application that has 2 tabs, one tab is wired to show a web page whose .aspx file has auto refresh set. The other tab doesn't access the web page at all. When I access any of the tabs I see that the web page is refreshing(hear the clicking sound), instead I want to disable the web page refresh whenever I access the 2nd tab. I set the "AllowNavigation" property of the webbrowser control to false when tab is switched to the 2nd one and set this property to true when I switch the tab to the 1st one. But what happens is when I switch back to the 1st tab the auto refresh doesn't work unless and until I click some web page controls. Is there a way to enable/disable auto refresh of a web browser control from Win forms?

    L 1 Reply Last reply
    0
    • U User 3362983

      I have a application that has 2 tabs, one tab is wired to show a web page whose .aspx file has auto refresh set. The other tab doesn't access the web page at all. When I access any of the tabs I see that the web page is refreshing(hear the clicking sound), instead I want to disable the web page refresh whenever I access the 2nd tab. I set the "AllowNavigation" property of the webbrowser control to false when tab is switched to the 2nd one and set this property to true when I switch the tab to the 1st one. But what happens is when I switch back to the 1st tab the auto refresh doesn't work unless and until I click some web page controls. Is there a way to enable/disable auto refresh of a web browser control from Win forms?

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Member 3365607 wrote:

      But what happens is when I switch back to the 1st tab the auto refresh doesn't work unless and until I click some web page controls.

      And if you navigate to, say, Google when you hide the browser, and navigate back to the .aspx when you show it? Another alternative would be to download the webpage and to save it directly to a string/a file. Then you could manipulate the webpage before displaying it in the browser. That way you can change any meta-refresh tags before feeding it to the browser :)

      I are Troll :suss:

      U 1 Reply Last reply
      0
      • L Lost User

        Member 3365607 wrote:

        But what happens is when I switch back to the 1st tab the auto refresh doesn't work unless and until I click some web page controls.

        And if you navigate to, say, Google when you hide the browser, and navigate back to the .aspx when you show it? Another alternative would be to download the webpage and to save it directly to a string/a file. Then you could manipulate the webpage before displaying it in the browser. That way you can change any meta-refresh tags before feeding it to the browser :)

        I are Troll :suss:

        U Offline
        U Offline
        User 3362983
        wrote on last edited by
        #3

        Thanks Eddy. I will try that. Looks like the web browser control cannot control the auto refresh of .aspx. I couldn't get ur question : And if you navigate to, say, Google when you hide the browser, and navigate back to the .aspx when you show it?

        L 1 Reply Last reply
        0
        • U User 3362983

          Thanks Eddy. I will try that. Looks like the web browser control cannot control the auto refresh of .aspx. I couldn't get ur question : And if you navigate to, say, Google when you hide the browser, and navigate back to the .aspx when you show it?

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Member 3365607 wrote:

          And if you navigate to, say, Google when you hide the browser, and navigate back to the .aspx when you show it?

          You could let the WebBrowser navigate to another site (Google only as an example) when you switch to tab 2. When the user switches back to tab 1, navigate to the original .aspx page again. That at least prevents the clicking-sounds of the refresh :)

          I are Troll :suss:

          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