.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

How to Set System.Windows.Controls.WebBrowser.Document Property , navigatetostring,stream DONT WORK

Posted By:      Posted Date: September 27, 2010    Points: 0   Category :WPF

Hi , i search in google , bing , cuil and all of searchs provider for the solution of this problem :


I get HTML content from HTTPWebRequest(because is much requests and if i use WebBrowser control directly i get a lag and video processing unnecessary)


And i need  set System.Windows.Controls.WebBrowser.Document with this text.


"Solution" , use new methods call NavigateToString() or NavigateToStream()

BUT THIS PROBLEM , both DON'T work with <javascript src="something.js"> or <style src="something.css">

Navigates ONLY read and process content INSIDE this tags , no external files (like 'something.js')

Solution i encountred after two weeks of search

Process the text and replace the files by the content of that.

But this i think that is no real solution. (i tested , work , but not perfectly) * I write my own code because that post dont have source code.

for why you need to do that?

because i need interact with users after search , and use html's input to re-search again and process this file with all extern files is too slow

Any solutions?

C# Lenguage

Sorry for bad english, i'am brazilian.


View Complete Post

More Related Resource Links

Uri does not work when assigned to System.Windows.Forms.WebBrowser



I have this uri http://maps.google.com/maps/api/staticmap?size=622x276&maptype=roadmap%5C&markers=color:red%7Clabel:A%7C%41%52%4C%C3%98%56,SE&sensor=false 

probing a city in sweden called Arlöv (%7C%41%52%4C%C3%98%56)

The uri works perfectly when pasted into IE.

It works when i go through the HTTPRequest

But It does not work when assigned to the System.Windows.Forms.WebBrowser, like so:  

Dim url As String = "http://maps.goog

Weird Exception: Method not found: 'Double System.Windows.Controls.ScrollViewer.get_ContentHorizon

Hi guys I have an XBAP application that uses a Xamdatagrid from Infragistics. I have some filtering on this grid, that rebinds after a filter. The problem is, when a user has scrolled to a certain point and then filters, the rebinding causes the grid to scroll to the beginning position of the grid. Now how I solve this is by getting an instance of the ScrollViewer, I get the ScrollViewer.ContentHorizontalOffset and then I do a ScrollViewer.ScrollToHorizontalOffset after it filters.   Now here comes the problem. For 99% of the users of this xbap app, this will work absolutely fine. Most, if not all of the users run exactly the same machines, XP 64 bit with 8GB RAM. The other 1% get the error: Method not found: 'Double System.Windows.Controls.ScrollViewer.get_ContentHorizontalOffset()'. I cannot reproduce this error on my own box, our dev server or our production server, it is a phantom exception that only pops up on a certain condition. I have even wrapped the "offending" code in a try catch and it still doesn't solve it. If I set the DispatcherUnhandledExceptionArgs Handled to true, it works, but it doesn't feel right. How is this possible? If the method doesn't exist, how can it compile? Why does that method exist for 99% of the other users running the exact same machines? I have googled my fingers raw without any valid results and this issue is frustrat

SpellCheck (System.Windows.Controls) support for other Languages

Hi, I have a question about SpellCheck class. I use .NET 4.0 and I know that 4 languages are supported. I need to write an easy editor with spell check functionality. It will need to support Dutch language. Depending on when Dutch Language will be supported, the current project will go in different directions. Could you provide me any information about when it is going to happen (if it is going to happen)? With kind regards, Michal Bilinski, Meteo Consult, the Netherlands.

System.Windows.Forms.WebBrowser strips out #fragments

I have a WebBrowser called webBrowser. I call: webBrowser.Navigate(@"file://C:\Documents and Settings\michaelb\Local Settings\Temp\tmp2F.tmp\OPS\main3.xml#section_5343"); I have a handler for the Navigating event: void   webBrowser_Navigating(object sender, WebBrowserNavigatingEventArgs e) Inside the handler I see that e.Url has no properties in which the fragment (i.e. the # onwards) has been retained - all knowledge of the fragment has vanished. I saw a posting in the WPF forum where a developer had noticed that the WPF browser control was doing this with a URL using the http:// scheme. The expert responding said that this was a known problem and that the workaround was to use the traditional WinForms browser control (i.e. the one I am using). I, however, am seeing that same problem with this WinForms browser control - the only difference that I am aware of between my case and that described in the other post is that my URL uses the file:// scheme. Anyone know a fix? Regards, Michael

What do I need to use references System.Windows.Controls.DataVisualization.Toolkit, WPFToolkit, Exce

Hi. My friend gave me a WPF application source code made with Visual Studio C# Express 2008. So I downloaded and installed Visual Studio C# 2008 and opened the project. But it will not compaile because some references have warning icons on them, the ones I stated in title. So what am I missing? I have 32 bit Windows 7, I have .NET framework 3.5 and Office 2007.

System.Windows.Forms.WebBrowser unable to update or change


I am using this WebBrowser component in a C# project.

I have declared and use "_wb" as shown below::

string httpcmd = @"https://...........";

System.Windows.Forms.WebBrowser _wb = new System.Windows.Forms.WebBrowser();                
_wb.ScriptErrorsSuppressed = false;                
Uri myuri = new Uri(httpcmd);
_wb.Url = myuri;
while (_wb.ReadyState != System.Windows.Forms.WebBrowserReadyState.Complete)


The above code in within a class.

Once my program uses the above code once, it then does seem possible to change.

i.e. After the first iteration, nothing changes each time the code is run.

The DocumentText property I reference stays the same once it is set.

It is like the URI is not even re-sent.

Only if I close the application and then re-run then the webbroweser will update as desired.

I have seen many references to this problem but have not been able to resolved it.

Can anyone suggest how to get this componet to reset or clear so it behaves like I have re-run the application?


"Unable to cast object of type 'System.Windows.Controls.Expander' to type 'System.Windows.Control



I Got This Error: "Unable to cast object of type 'System.Windows.Controls.Expander' to type 'System.Windows.Controls.GroupBox'"


In XAML file Code of Control Herarchy is like this





here i declare 10 Expander

<Expander 1>...<expander10>

and in each expander there is 1 <Grid> Control





Now my code is working fine....but problem is i want to remove Expander10

so i removed <Expander10> andrelated code from CS file.

codes compiled successfully. but when i Open this screen i got this error on InitializeComponent() and Error shows in XAML page.


"Unable to cast object of type 'System.Windows.Controls.Expander' to type 'System.Windows.Controls.GroupBox'"

Please Help me for this Error.

it's really strenge what's wrong in removing expander from herarchy......

How to programmatically add controls to Windows forms at run time by using Visual C#

Create a Windows Forms Application
Start Visual Studio .NET or Visual Studio 2005 or a later version, and create a new Visual C# Windows Application project named WinControls. Form1 is added to the project by default.
Double-click Form1 to create and view the Form1_Load event procedure.
Add private instance variables to the Form1 class to work with common Windows controls. The Form1 class starts as follows:

all basic windows controls,wpf controls,silverlight application

here you will find all the information from basic.

Category attribute of user control property does not work correctly in categories tab.



I have a User Control (ascx) and a property which a want to display in my categories tab in Visual Studio in the category named "Styles".

[Category("Styles"), DefaultValue(""), Description("The value for formating something.")]
public String MyFormatProperty
set { /* the code for set */; }
get { /* the code for get */; }

And here is the problem: Actually I do not need a get, because I only have to set the property (write only property). But when I omit the get, the property is displayed in the "Misc" category in the categories tab in Visual Studio. Only when I code the get as well, then the property is displayed correctly in the "Styles" category in the categories tab in Visual Studio.

Does anybody know why? How can I display the category correctly only with set?

Thanks, S.

Team System: Customizing Work Items


Team Foundation Server's work iIem tracking system provides a number of advanced customization options.This article explores custom control support that lets you link to date, enhance the user experience, present data, and more.

Brian A. Randell

MSDN Magazine October 2009

CLR Inside Out: Extend Windows Forms Apps Using System.AddIn


See how Windows Forms applications can be adapted to use the new .NET Add-in framework (System.AddIn) this month.

Mueez Siddiqui

MSDN Magazine July 2008

Team System: Work Items and Undo Support


Add support for work items to the Team Foundation Server version control add-in.

Brian A. Randell

MSDN Magazine September 2007

Team System: Work Item Tracking


In this column, Brian Randell explains how to build a simple Work Item explorer and demonstrates the core operations needed to add work item support when building your own add-in.

Brian A. Randell

MSDN Magazine April 2007

RibbonX API: Extend The 2007 Office System With Your Own Ribbon Tabs And Controls


If you want to create your own professional looking tabs and controls in Office, check out the RibbonX API of the 2007 Microsoft Office system.

Eric Faller

MSDN Magazine February 2007

Text Rendering: Build World-Ready Apps Using Complex Scripts In Windows Forms Controls


The System.Windows.Forms.TextRenderer class provides support for complex scripts in Windows Forms controls so you can render text the way you want and support international locales.

Miguel A. Lacouture

MSDN Magazine March 2006

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