WebBrowser control - design mode - relative paths
Is there any way to get the WebBrowser control (in design mode) to show images which are referenced with a relative path, such as this:
HTML Code:
<IMG src='page1_files/image1.jpg'>
If I use an absolute path it works fine:
HTML Code:
<IMG src='file:///C:/Users/Paul/AppData/Local/Web_Editor/page1_files/image1.jpg'>
Is it possible to tell the WebBrowser the "starting location" when using relative paths?
(I have just about finished converting all src locations by manipulating strings, but it just occurred to me I might have missed an easier way!)
Re: WebBrowser control - design mode - relative paths
After a bit more Googling ... it seems that using the WebBrowser control as an editor effectively navigates to about:blank and you can't reference files from there. There doesn't seem to be any kind of "default directory" property that you can use a starting point for relative paths.
Still open to other suggestions though ...
Re: WebBrowser control - design mode - relative paths
Balderdash! (I've always wanted to say that on this forum!) If it navigated to about:blank then you wouldn't be able to see the document you're editing! The reason you can't reference files is that the HTML is not being interpreted the same way that it is when you navigate to a page. That's kinda what design mode means!
Re: WebBrowser control - design mode - relative paths
It's a shame there isn't a property to define the "starting directory" when in design mode. Lots of people in Google-land looking for the same thing as me. Anyway, I've managed to do the necessary with string manipulation.