.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Opening links from WPF WebBrowser control in default browser instead of IE

Posted By:      Posted Date: October 03, 2010    Points: 0   Category :WPF
I am working on a WPF application that uses System.Windows.Controls.WebBrowser to display an embedded HTML page.
The problem I have is that all links from that page that are to open an external browser window (with target="_blank") open Internet Explorer instead of the configured default browser.
How do I tell the WebBrowser control to respect the default browser settings?

View Complete Post

More Related Resource Links

Write a web browser WITHOUT using WebBrowser control.


Hi All,

I have a unique project in mind which is based on a web browser, but requires that I perform some of the actions that the WebBrowser control does instead.

Basically, I want to be able to intercept/handle the web browser's requests and return data to the control which outputs the data to the clients screen.

For example:

1) A client requests a page.
2) My code handles this request and returns the HTML to the control.
3) The control then sends requests for each component which makes up the page (images, etc) and sends the requests to my handler.
4) My handler gets the data and returns it to the control.

Is there a way I can achieve this?


If you already know the candle light is fire, the meal was cooked a long time ago...

default.browser from asp.net 3.5 to asp.net 4.0


hello, it's me again :-)

a (maybe) stupid question:

in asp.net 3.5 i've this .browser file:


<browser refID="safari1plus">


<adapter controlType="System.Web.UI.WebControls.Menu" adapterType="" />





now i suppose that in asp.net 4.0 this is not useful.

So what i've to do? I've simply to delete "App_Browsers" folder in my converted project or i've to put in this folder:














What's the best way?

Thank  you very much!

Browser window is opening up on the second click with javascript code



I am trying to set a javascript code to open up a new browser window with this URL that exists like shown below.

On the first click nothing happens but on the second click the browser window is opening up.


How is it possible to make it open up on the first click ?

                                <asp:ImageButton ID="ImageButton3" runat="server" Height="84px" 
                                    ImageUrl="~/images/1.jpg" Width="165px" 
                                    onclick="ImageButton3_Click" />

    protected void ImageButton3_Click(object sender, ImageClickEventArgs e)
        String openURL = "javascript:window.open('" + "Folder1/testing.aspx" + "');return false;";
        ImageButton3.OnClientClick = openURL;


Explorer Browser Control

I am having a problem with the Explorer Browser sample code from Windows 7 API Code Pack. I need to programmatically highlight and give focus to an item in the left hand pane of an Explorer Browser control just as if I had clicked on it. "eb.ExplorerBrowserControl.Navigate(   CType(KnownFolders.Computer, ShellObject))" will highlight it but will not give it focus.  How do I simulate in code what happens when I acutally click on 'Computer' in the left-hand pane? Then how do I send the Tab Key?  Will this work? "SendKeys.Send("{TAB}")"

Links to open new browser window?

I've setup some links on "My Site" and can't seem to figure out how to get them to open the links in a new window. I'd also like to do this for my RSS feed links.(This is in MOSS 2007) Can someone help?

Inside the "Default Browser Switcher" extension

You may have already heard of the recently WoVS extension "Default Browser Switcher" (download from Visual Studio Gallery or from Extension Manager inside VS) that helps in choosing what browser you want to launch from VS while debugging your ASP.NET applications. You can start by reading the original post from Scott Hanselman where he describes some interesting inner workings of VS related to how it handles the launching of the VS default browser. Note this is the default browser to be launched from VS which may or may not be your default system-wide browser. If you're brave enough to survive Scott's post then you're ready to enter some even more obscure details: how to package that into an extension for Visual Studio. We started by defining the set of commands we wanted to support and we ended up with ten commands total. That is a "Set default Browser to X" command multiplied by Internet Explorer, Firefox, Chrome, Safari and Opera and a "View in Browser X" command multiple by the same number of browsers. The first set would go into a VS Toolbar and the second set would go into a sub menu whose parent would be a new "View in Browser" command. To author the UI we used the very handy and friendly VSPackage Builder which allowed us to quickly design our 10 commands and place them where we wanted inside VS:   (Yes, that's a DSL for authoring your own custom UI inside

How to open an excel document in a webbrowser control

Hi,  I have an XBAP app that we would like to be able to open an Excel doc in a WebBrowser control but instead we always get prompted to opne in Excel.  Is this possible?  Here is what I have tried.  The reports are in SharePoint but we want to show them in our own application not SharePoint.       System.Windows.Forms.WebBrowser ReportView = new System.Windows.Forms.WebBrowser();     WindowsFormsHost ReportViewHost = new WindowsFormsHost(); ReportView.Navigate(_fileName,   "_self", postBytes, "Content-Type: application/vnd.m?s-excel"); ReportViewHost.Child = ReportView;   _filename would be something like http://localhost/shared%20documents/myfile.xslsx Thanks for any suggestions. Rhonda

Possible bug in WebBrowser Control realization in WPF and Windows Phone 7

Hello, I'm tried to make authentication component for russian social network Vkontakte.ru (vk.com). In russian forum nobody answered me. The proplem: When authentication is complete WebBrowser component must be redirected to page like: http://vkontakte.ru/login_success.html#session={%22expire%22%3A%221272008089%22%2C%22mid%22%3A%22100172%22%2C%22secret%22%3A%229c8d8f0305%22%2C%22sid%22%3A%221131703552161ae352a1256402e3140d7cbde41b1602a93d15472c82%22} In Windows Form application all works normal. But in WPF browser was redirected to http://vkontakte.ru/login_success.html Without #session.... It happened not only in WPF Applications, but even in Windows Phone 7. It is a bug? Or this parameter can be accessed from another place?

Pfobldm while printing from CR control in browser

Hi,      I am experiencing a problem while printing from CR viewer control from browser. Insted of printing report to printer whole web page gets printed. I am using VS2008 and FW 3.5 ASP.NET Nilkanth Desai  

Change the Default Date in the Date Picker Control

Hi, I have a WPF Datagrid in which one of the columns is a Date Column. So i have used a DataTemplateColumn as Follows     <my:DataGridTemplateColumn CellTemplate="{StaticResource EffDateDateTimePickerControl}"   CellEditingTemplate="{StaticResource addrEffDate}" Header="Effective Date"/> And in my Resource File i have written the following code: Style   TargetType="{x:Type my:Calendar}" x:Key="CalenderControlTemplate">     <Setter Property="Template">     <Setter.Value>     <ControlTemplate TargetType="my:Calendar" >     <my:CalendarItem Name="myCalendarItem"   Background="White"   BorderBrush="Black"   BorderThickness="1"   VerticalAlignment="Center" />     </ControlTemplate>       </Setter.Value>     </Setter>     </Style>       <DataTemplate x:Key="EffDateDateTimePickerControl">     <Label x:Name="lblEffDate" Content="{Binding effectiveDate,Mode=TwoWay}" ></Label>     </DataTemplate>     <DataTemplate x:Ke

Why SS Browser service run under default NetworkService?

During SQL Server 2008 setup only SQL Server Browser service had default "NT Authority\NETWORK SERVICE" to run under. The other services  had no defaults  Why does SQL Server Browser service have default "NT Authority\NETWORK SERVICE" to run under? What's for? And why do not  others have default?  

opening a web browser without opening form on windows form load event

Hello All, I have a main frame which has a display button. after clicking on display button I usually open a windows forms. Now I have a requirement to open a web page after clicking on display button. I should not show windows form to the user. for that I had written following code in the Form_int (override) event of windows form. System.Diagnostics.Process.Start(http://www.google.com); and I commented out ShowDisplay(); code.  Everything looks good till now and when I run the project and clicked on display button web browser has been opened, but if I click again another web browser is being opening. but I don't want another browser to be opened. can anybody please help me in that. Thanks in advance.

How to Set default file name of image in FileUpload Control

helloi want to set  default value in Fileupload control.Because when i select file name using fileupload then save that file to sqlserver database i got problem when no file is select. so i found alternate of that i should store default image into database through fileupload control but now my query is how to set default image to fileupload control.please i want source code.i really need it......tnx in advance

Opening a folder in a new browser

Hi, Developing a web application in C# which stores files in a tree structure in a server.A project ( eg: ABC) has many sub folders (eg: ABC_sub1,ABC_Sub2...etc) . Each sub folder will have many types of files. (Eg: .dat,.txt .... etc)I have stored the project name and the path to the parent folder ( in this case ABC) in a database.Eg: \\sereverName\Test\MyProject\ABCWhat I need to do is when a user selects a given project ( eg; ABC) & clicks the link button component  called "browse"  to open the folder (\\sereverName\Test\MyProject\ABC) in a new window.This is the code I thought would work.protected void LinkButtonFolderBorwse_Click(object sender, EventArgs e)    {        string myPath = @HiddenFieldFolderLocation.Value;        System.Diagnostics.Process prc = new System.Diagnostics.Process();          prc.StartInfo.FileName = myPath;        prc.Start();    }HiddenFieldFolderLocation.Value gets the path of the parent folder (\\sereverName\Test\MyProject\ABC).When I click the link button nothing happens.Any help would be greatly appreciated.Thanks
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend