C # WebBrowser.Navigate Issue

I have an XML file stored in a DEBUG folder inside my application's BIN folder (BIN \ DEBUG \ File.xml)

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

It does not update the view to display the file. I know this is because it can't find the file due to the wrong folder location. The file must be accessible from this folder.

Help evaluate

+1


a source to share


2 answers


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



WebBrowser1.Navigate(Path.Combine(Application.StartupPath, "File.xml"));

      

+3


a source


webBrowser1.Navigate(Environment.CurrentDirectory + @"\File.xml");

      



This is what I use, unless the directory has been changed, of course. :)

0


a source







All Articles