.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

Add Link in webbrowser control using VB NET

Posted By:      Posted Date: April 14, 2011    Points: 0   Category :Windows Application

How to insert a link in webbrowser control without webBrowser1.Document.ExecCommand("CreateLink", True, Nothing).

I've tried to add with webBrowser1.Document.ExecCommand("CreateLink", False, "<a href='http://www.microsoft.com'>microsoft</a>"), but doesn't work.

Note: I don't have problem with:

webBrowser1.Document.ExecCommand("insertimage", True, Nothing)

webBrowser1.Document.ExecCommand("CreateLink", True, Nothing)

webBrowser1.Document.ExecCommand("EditMode", True, Nothing)

and others command

could you help me?



View Complete Post

More Related Resource Links

video tutorial link for composite and rendered custom server control


hii all

i am new to technology so go easy on this post

according to what i read from web there are 3 type of custom server controls

1 superclass

2 composite

3 rendered

i found video tutorial for superclass custom server control but couldnt find video tutials for other 2.

please forward me link for composite and rendered custom server controls video tutorial  

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?

How to enable own shortcut within WebBrowser control in Windows form application




I am developing a windows form application with C#, where I have placed WebBrowser control... I load some web page in this webbrowser and I need to know, that after I press my own certain shortcut that it will allow me to call my handler...

It should work something like this => I have certain textbox on web page and after pressing my own shortcut, it will call my handler which will automatically type certain text (which will be prepared in that handler) into that textbox... 

Could you advice me, how to make this happen or if it is even possible?


Thanks a lot in advance

How to populate a link on a Label control?


I have a requirement where I need to place a link inside a label. I am giving the method below for your reference.

  public override void PopulateDataUI(Object o)
              CustomerInvoice data = o as CustomerInvoice;

              CIPI_InvoiceNumber.Text = data.InvoiceNumber.ToString();

            //I have written as below but it's not working.    

            //LinkLabel lnk = new LinkLabel();
           // lnk.Text = data.InvoiceNumber;
           // CIPI_CustomerName.Text = lnk.Text;


       NB:     CIPI_InvoiceNumber is the name of the Label I am using.


Can anybody please  suggest me a solution. I am working on C#.net 3.5 and my project is a Windows Application






WebBrowser control, svg and WIndows 7


Hi, I have a problem with a WebBrowser control using C# 2.0 showing svg content.

The problem is the following:

I have a simple Form with a WebBrowser control in it. the link that i try to load is this: http://www.croczilla.com/bits_and_pieces/svg/samples/arcs1/arcs1.svg (just an example)

If I execute it on Windows XP, the control displays the svg correctly, while on Vista and Windows 7 it shows a blank page... anyone can tell me why?

To show svg I have installed the adobe svg viewer and I have IE8 installed too

Of course if I navigate to that page using directly IE8 everything works.

Thanks in advance for your help


WPF WebBrowser Control on x64 machines Launches new IE window instead of staying inside of control.


I have a WPF app that uses an embedded WebBrowser control.  I have been using this as a video player (i would have used MediaPlayer, but it doesn't support H.264 in XP)  Anyway, I am using a 3rd party video player to display the h.264 videos, and this has been working fine.

We started testing on 64 bit Windows 7 and now whenever we attempt to play the videos, the WebBrowser launches a separate IE window and plays the video there instead of within my app.

I have googled this bug and have seen hints about handling the NewWindow2 event, but have yet to see a decent example that isn't a total HACK..

Does anybody know a way to stop the WebBrowser control from launching separate IE windows on a 64 bit OS?

Thanks a lot,


Gridview Link Button control click event


Respected Reader,

I have  Web page that uses LinkButton control inside Template Fields of Gridview.

I am trying to work on LinkButton Click event and trying to preserve the Value of LinkButton that user click, and based on that value, i want to refresh tha page data.

I used CommandName and CommandArgument property of Linkbutton, but i can use that property only in GridView_RowCommand method by checking e.CommandName expression. But the problem with that Gridview_RowCommand event fire after all other page_load activity. So the value never used in the page_load event to refresh the data in all other control.

I also tried to use OnClick Method, Session variable and Hidden variable. but when i run Response.Redirect method from Gridview_RowCommand, it clear all the Session and Hidden variable values. also tried (Response.Redirect(,false)) method but never got success.

Any suggestion will be appricated in advance.

Visual Studio WebBrowser control's PrintPreviewDialog generates "VSHost32.exe has stopped working"


I'm getting a problem with a VS 2008 application when I use the WebBrowser control's .ShowPrintPreviewDialog method and either print or close the dialog box.  I'm working on a 64-bit Windows 7 computer and using Visual Studio's default Debug option settings.  The problem happens both when running from the IDE in debug mode and after compiling in x86 mode as a stand-alone.

The control is central to as an otherwise effective report management system, so on btnPrint_Click I assign HTML code to .DocumentText and then call .ShowPrintPreviewDialog, which works fine, other than it does need 2 clicks so it seems both stages have to happen as separate events? 

Although when I go to print, the document prints okay, the print preview dialog form closes itself and whole program crashes with the above message.  I've also tried separating those stages to avoid the 2-click issue, but I still get the crash.

If I turn Project>Properties>Debug>"Enable unmanaged code debugging" ON, I get this message instead "Unhandled exception at 0x752c77df (urlmon.dll) in PMPos.exe: 0xC0000005: Access violation reading location 0x00000001."

The control's other print dialog methods work fine.   Is there a solution that I can rely on when distributing the application or am I best abondoning this particular

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

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?

Open Power point presentation in WebBrowser Control with out MS Office installation on the machine


I want to start a Microsoft Powerpoint presentation inside the WebBrowserControl. I followed the procedure in http://support.microsoft.com/kb/304662
The PC only has Microsoft Powerpoint Viewer  and there is no office installed. The client does not want office installed on the machine

If  Microsoft office is installed the change of  the File type settings under Folder Options the 'Browse in same window' to true works but without MS office installation this setting is not available.

Please let me know the alternative to have the power point open in WebBrowser Control without MS Office.

Error When a Word Document is displayed in WebBrowser Control



We are using a WebBrowser control to display an MS Word document in a form. This was working fine for a long time, and now we tried to install this application in a new server. Now we are facing an issue. When we try to open the word document by using WebBrowserControl.Navigate method, it is asking the Open/Save dialog box, which is typically displayed when we download a file. Then if the user clicks on Open button, we are getting an error "Windows cannot find 'UsersTempFolder\1\Temp\MyDoc.DOCX'. Make sure you typed the name correctly, and then try again. To search for a file, click the Start button, and then click Search.". Please note that UsersTempFolder\1\Temp\MyDoc.DOCX is NOT the path I have given in Navigate method. Also, if I click Save in open/save dialog box, I can save to a location and open it.

I don't have direct access to this server, but if I can believe the words of support person, every configuration is set same as our old server. Here is the details.

.NET Framework 3.0

MS Office 2003

Internet Explorer 6 SP2.

Could any one please help me to solve this issue? Any help is very much appreciated. Please let me know if you need any other details.



WebBrowser Control HtmlDocument DOM will not update

Hey Guys,

I'm writing some code using the C# WebBrowser control. I'm trying to build the DOM programatically, but I cannot get the webbrowser to reflect what is contained in the webbrowser.Document HtmlDocument.

// Navigate to a blank page
// get document, write initial HTML (otherwise the Body property of the Document is null)
doc = webBrowser1.Document;
// Wait for webBrowser1 to load
} while (webBrowser1.IsBusy);
// Create a table element
HtmlElement table = doc.CreateElement("TABLE");
table.Style = "width:100%;";

WebBrowser control scrollbars not active in certain pages

And when the page loads both scrollbars are not active(i can't use them), i mean i have to click on one of the scrollbars and then they become active. It works ok with other websites ofcourse, does anyone know what's wrong? IE for example doesn't have that problem with this website. Also i can't use the mouse scroll. I have to click somewhere in the page and then the mouse scroll and the scrollbars becomes active.













 Form1 : Form





 sender, EventArgs e)

how to set onclick to link from menu control



I have a content page in which I have set a jsp page using <script> tag. I have created a function to open the page. I need to be able to click the different pages from the menu control.


<asp:Content ID="Content1" ContentPlaceHolderID="menu1" Runat="Server">

<script type="te

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