Back to list
Views:   17.6K
Replies:  2

ASP.NET and programmatic opening different browsers

I have a quick question:
When clicking on a button in ASP.NET, is it possible to open a different Browser?

Suppose I have page with two buttons: A and B.

When clicking A -------------------> open page in new Internet Explorer instance.
When clicking B -------------------> open page in new FireFox (or any other browser) instance.

Sabbi Sudhakar, Oct 27, 2010
Reply 1

This is a nice idea to open two different browsers using two different buttons.

But each operating system has a setting of default web browser for each user profile. So this type of implementation is not recommended.

.Net provides System.Diagnostics namespace, which has a Process class. This process class provides a method called Start(). Using this Start() method you can run any process. If you want to implement the same feature in Windows Forms application then it is quite possible. But in case of web applications this will not support. Because if you will try to use System.Diagnostics namespace and code using its classes in web application, the code will be executed at server side not at the client side. so it is not possible to implement the same in web application.

Also one option may be to use javascript. But using javascript also it is not possible to identify whether a particular web browser is installed on the client machine or not.

Hetalkumar Kachhadiya, Nov 02, 2010
Reply 2
The OS has a setting for the default web browser on your system. This setting determines
which browser will open when you click on a link.

That being said, if you want to open Urls in different browsers, you will need to know the
path to the specific browser and open it using Process.Start or similar. Though I wouldn't
recommend it if it is for any other use than your own.


Robert Blixt, Oct 31, 2010
Hi Dan, many thanks for your detailed answer - very helpful. Wolfgang
Aug 25, 2010
Stay Inspired!
Join other developers and designers who have already signed up for our mailing list.
Terms     Privacy     Cookies       Do Not Sell       Licensing      
Made with    in Austin, Texas.  - vsn 44.0.0
© Data & Object Factory, LLC.