When a IE browser control is embedded in a winform and the link on a page contains a relative file path the URL coming into the callback for the navigate event seems to lose “file:///../../dir/file.htm” and becomes “file:///dir/file.htm“
private void OnNavigating(object sender, WebBrowserNavigatingEventArgs e)
{
// looking at e.Url to see what happens
}
Has anyone seen similar problems? Any suggestions?
I think your URL is incorrect. If you want a relative path, just specify a relative path, such as
../../dir/file.htm. If your URL starts with a protocol specifier, then it’s an absolute URL, where a..at the start is superfluous, since you’re already starting at the root of the file system.