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. C#
  4. Webbrowser Control

Webbrowser Control

Scheduled Pinned Locked Moved C#
questionhtml
4 Posts 3 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.
  • H Offline
    H Offline
    hadad
    wrote on last edited by
    #1

    Hello, I am using the following code to delete an HTML element form a document displayed in a webbrowser control:

    HtmlElement elem = webBrowser1.Document.GetElementFromPoint(e.ClientMousePosition);
    elem.OuterHtml = "";
    MessageBox.Show(webBrowser1.DocumentText);

    but when I display the webbrowser documenttext property I found the original html including the deleted element! How can I delete an html element in a web browser control?

    Dad

    M L 2 Replies Last reply
    0
    • H hadad

      Hello, I am using the following code to delete an HTML element form a document displayed in a webbrowser control:

      HtmlElement elem = webBrowser1.Document.GetElementFromPoint(e.ClientMousePosition);
      elem.OuterHtml = "";
      MessageBox.Show(webBrowser1.DocumentText);

      but when I display the webbrowser documenttext property I found the original html including the deleted element! How can I delete an html element in a web browser control?

      Dad

      M Offline
      M Offline
      Mycroft Holmes
      wrote on last edited by
      #2

      Never having used the web browser control I am guessing so! I presume when you load in the document you are reading from the original, you then delete a control in the browser control. This ONLY affects the copy loaded into the control NOT the original source.

      Never underestimate the power of human stupidity RAH

      H 1 Reply Last reply
      0
      • M Mycroft Holmes

        Never having used the web browser control I am guessing so! I presume when you load in the document you are reading from the original, you then delete a control in the browser control. This ONLY affects the copy loaded into the control NOT the original source.

        Never underestimate the power of human stupidity RAH

        H Offline
        H Offline
        hadad
        wrote on last edited by
        #3

        OK, but how can I get the new html copy from the web browser.

        Dad

        1 Reply Last reply
        0
        • H hadad

          Hello, I am using the following code to delete an HTML element form a document displayed in a webbrowser control:

          HtmlElement elem = webBrowser1.Document.GetElementFromPoint(e.ClientMousePosition);
          elem.OuterHtml = "";
          MessageBox.Show(webBrowser1.DocumentText);

          but when I display the webbrowser documenttext property I found the original html including the deleted element! How can I delete an html element in a web browser control?

          Dad

          L Offline
          L Offline
          leppie
          wrote on last edited by
          #4

          You will have to remove the element from it's parent. I dont think setting OuterHtml will have any effect.

          xacc.ide - now with TabsToSpaces support
          IronScheme - 1.0 alpha 4a out now (29 May 2008)

          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