Click here to Skip to main content
15,906,106 members
Please Sign up or sign in to vote.
3.50/5 (2 votes)
See more:
Hello, I have a problem, I want to open a browser many times, but I dont want to open a new window every time, but do that in one window, is that possible without browsercontrol?
Example code:
C#
private void button1_Click(object sender, EventArgs e)
       {
           string url = "link/id=12345";
           System.Diagnostics.Process.Start(url);
       }


The ID will warry and I want to work only in one window.
Thank You
Posted
Comments
Sergey Alexandrovich Kryukov 26-Jun-13 11:05am    
What browser, in what application type? What's the problem? Why doing so? Why not simply navigating with the same browser instance?
—SA
Soloveikok 26-Jun-13 11:24am    
Browser is default, currently using mozilla, the problem is that when Button_1_click happens, application opens a new windows with the current URL, But I want so the browser would just navigate from page to page in one window, I need this so I could navigate from page to page more quickly, not typing the link manually all the time, but with a simple app just go to the link I need. I want to navigate in the default browser, not the builtin wrapped webbrowser1

1 solution

C# alone, the answer is no. The given code only start the Browser process, but not actually doing anything with the browser control.

You may use
C#
HtmlPage.Window.Navigate(new Uri("http://stackoverflow.com/"), "_blank");

which will open on a new ab on IE.

you could try set your default browser to mozilla, but I am not sure if this will work.

reference:
http://stackoverflow.com/questions/16106503/htmlpage-window-navigate-opens-a-new-page-or-new-tab-on-every-click[^]
 
Share this answer
 
Comments
Soloveikok 26-Jun-13 14:14pm    
HtmlPage.Window.Navigate doesnt work for me, do i need to add somekind of reference?
sorawit amorn 26-Jun-13 14:32pm    
System.Windows.Browser.dll

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900