Don't quote me as this is kinda off the top of my head but you should be able to do something like this:
<c#> IHTMLDocument2 doc; IHTMLElement element; if (axWebBrowser1 != null) { doc = (IHTMLDocument2)axWebBrowser1.Document; if (doc != null) { element = doc.body; if (element != null) { element.innerHTML = value; return; } } } </c#> 8) sean -----Original Message----- From: James Crowley [mailto:[EMAIL PROTECTED]] Sent: Monday, December 02, 2002 8:06 AM To: [EMAIL PROTECTED] Subject: Re: [ADVANCED-DOTNET] STAThread, COM interop and ASP.net Andy, That was one of the things I was considering (and we're already using the mshtml assembly in conjunction with the web browser control). However, we were unable to get the mshtml DOM to work satisfactorially returning pages/frames... (in addition, I couldn't actually figure out how to get it not to display the IE window!!) Do you have any examples using solely the mshtml assembly to retreive a page and access its IHTMLDocument2 inteface? Thanks, ~ James Crowley Developer Fusion ---------------------------------- Web - http://www.developerfusion.com/ Email - [EMAIL PROTECTED] ICQ# - 60612011 Fax - +44 (0)870 706 4042 ---------------------------------- -----Original Message----- From: Moderated discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED]] On Behalf Of Andrew Hopper Sent: 02 December 2002 00:03 To: [EMAIL PROTECTED] Subject: Re: [ADVANCED-DOTNET] STAThread, COM interop and ASP.net Have you considered using the Microsoft.mshtml assembly instead? It provides all of the DOM functionality of the WebBrowser control without any of the threading issues (at least, none that I'm aware of...) Look in the Platform SDK for the MSHTML reference. -Andy Hopper ----- Original Message ----- From: "James Crowley" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, November 27, 2002 3:48 PM Subject: [ADVANCED-DOTNET] STAThread, COM interop and ASP.net > Hi, > > My component uses the WebBrowser control (via COM interop) to grab > certain bits of data from a web page. This works fine in a standard > app, but when I call it from an ASP.net page, you are told that we're > not using an STA thread, and the ActiveX control requires it. > > If I was writing an application with a Main() entry point, I'd just > stick in an [STAThread] attribute; but what do I do for my component? > If I add aspcompat=true to the ASP.net page, [which, I believe, puts > asp.net in STA mode] this sometimes works, sometimes hangs.... And I > really don't want customers to be having to stick in that tag for a > supposed .net component! > > Any suggestions? > > Thanks, > > ~ James Crowley You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com. - - You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com. You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com.