System.ArgumentException was unhandled - WebBrowser object

Hello,
I got this message
"System.ArgumentException was unhandled
  Message="Navigation to a relative URL unsuccessful."
  Source="System.Windows.Forms"

Well, that's not the whold message but it's like fifty lines of
code so....

Well, the question is for the WebBrowser object.
I placed a WebBrowser object on my form
then in properties, how do you put the URL in
do you put in like:
C:\myform\index.htm


or something else

What if you put in like 
C:\myform\index.htm,
and you have the "index.htm"
but the user doesn't have that
will VB take care of that, will it copy and
put in into the release bin then change the URL to the Bin folder


Thank you for all your help,
I am really lost on the WebBrowser Object!

Keehun Nam
 




Answer this question

System.ArgumentException was unhandled - WebBrowser object

  • Fairfield

    thank you very much,
    so if the .htm file is in the bin folder itself,
    can i just to something like
    /index.htm


    Thank You very much
    Keehun Nam



  • lukin

    Hi,

    You'll place the url in code this way:

            WebBrowser1.Url = New System.Uri("C:\myform\index.htm")

    No, VB doesn't automatically copies your html in your bin folder. You must manually include this in your bin folder and in your deployment. You could just specify the html filename without the location if your html is within the same folder as your exe.



    cheers,

    Paul June A. Domag


  • RajaGanapathy

    Hi,

    If its in the same folder as the exe, yes you can do that. And you can also use the System.IO.Directory.GetCurrentDirectory() to get the working directory of the exe and just parse it with your html...





    cheers,

    Paul June A. Domag


  • System.ArgumentException was unhandled - WebBrowser object