views:

1443

answers:

2

Hello,

I have an XML file stored in the DEBUG folder inside the BIN Folder of my Application (BIN\DEBUG\File.xml)

When i call WebBrowser1.Navigate("File.xml");

It doesn't update the view with the display of the file. I know it's something to do with it not locating the file due to the folder location being incorrect. The file has to be accessed from this folder location.

Help appreciated

+3  A: 

Do you have WebBrowser1.AllowNavigation set to true? Have you tried:

WebBrowser1.Navigate(Path.Combine(Application.StartupPath, "File.xml"));
Chris Doggett
Yes, you need to specify a fully-qualified path here. You can also use Process Monitor or FileMon to watch exactly where the WebBrowser control is *attempting* to load the file from.
EricLaw -MSFT-
A: 
webBrowser1.Navigate(Environment.CurrentDirectory + @"\File.xml");

This is what I use, if the directory hasn't been changed, ofcourse. :)

baeltazor