Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to display the string html contents into webbrowser control?

Tags:

browser

c#

I have a c# win app program. I save the text with html format in my database but I want to show it in a webbrowser to my user.How to display the string html contents into webbrowser control?

thanks in advance

like image 516
Anasheh Avatar asked Mar 19 '11 14:03

Anasheh


People also ask

How do I use WebBrowser control?

The WebBrowser class in code behind is associated with the WebBrowser control. So when you drag and drop a WebBrowser control to the Form, a WebBrowser class instance is created in the code behind. The Navigate method of the WebBrowser class is used to open a URL in the WebBrowser.

What is WebBrowser control?

The WebBrowser control provides a managed wrapper for the WebBrowser ActiveX control. The managed wrapper lets you display Web pages in your Windows Forms client applications.

What is Web browser control in VB net?

The Web Browser control in VB.NET allows you to host Web pages and other web browser enabled documents in your Windows Forms applications. You can add browser control in your VB.Net projects and it displays the web pages like normal commercial web browsers .


1 Answers

Try this:

webBrowser1.DocumentText =     "<html><body>Please enter your name:<br/>" +     "<input type='text' name='userName'/><br/>" +     "<a href='http://www.microsoft.com'>continue</a>" +     "</body></html>"; 
like image 194
i100 Avatar answered Sep 23 '22 09:09

i100