WebBrowser.DocumentText

I try to put some images to the webbrowser with .documenttext method but it can not show it.It shows x. I try all possible way of writing path but it didn't work. Can't we put an image to the webbrowser with this method

Answer this question

WebBrowser.DocumentText

  • kkam

    What are the image sources that you are using Are they absolute paths like C:\pathtoimage\image.jpg


  • mtsman

    Yes, that worked.  Thank you.

  • dlmac

    I have a similar problem.  I have absolute paths to the image files (testing this in the emulator, so the paths start with "\Storage Card"), but the images do not display.  I don't see the x that the other poster mentioned, but the images that should be there (and that are when I compile the exact code for windows xp) are not.  Is this a bug, or am I doing something wrong

    Thanks,
    Deborah

  • Cola_03

    I have the same problem. When I assign like this:

    webBrowser1.DocumentText = @"<html><body><img border=0 width=120 height=90 src=file://\temp\img.jpg alt=alt_text></body></html>";

    nothing appears in the browser. What's wrong with this

    Thx!


  • Roger Hsieh

    The problem resolved by installing the August-ServicePack for NETCF: a bug in webbrowser was fixed and the above mentioned assingnment works.


  • Moien

    Try it like that:

    file://\Your Directory\some.jpg


  • Amarelo_Mrt

    It is a windows CE project. I try both relative and absolute paths but it did not show them on the program.


  • WebBrowser.DocumentText