Home c# webbrowser doesn't load the url
Reply: 0

c# webbrowser doesn't load the url

bask185 Published in 2017-09-14 10:28:14Z

I have a panel which displays a form which displays a webbrowser. In the UI designer I added the Url of my .html file and it worked fine.

But now I am using my application on a different system and thus the path to the .html does not exists.

So I have to do it in code and use string sspBaseFile = System.AppDomain.CurrentDomain.BaseDirectory;

In this function I am trying to get it to work. The form has a UI element called webbrowser1

private void SSP_Load(object sender, EventArgs e)
        this.webBrowser1.DocumentTitleChanged += new EventHandler(webBrowser1_DocumentTitleChanged);

        webBrowser1.AllowNavigation = true;
        this.webBrowser1.Navigate(new Uri(sspBaseFile + "frmSSPeditor.html"));           

Why isn't the html displayed? I verified that the .html is in the correct place, next to the binary.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.365984 second(s) , Gzip On .

© 2016 Powered by cudou.com design MATCHINFO