How do I display XML in the new .NET 2.0 WebBrowser control

  • Thread starter Henrik Skak Pedersen
  • Start date
H

Henrik Skak Pedersen

Hi,

I would like to show XML in the new builtin WebBrowser control. I have the
xml in a string.

I am trying to set the DocumentText property to my xml text. But the control
only shows the values and not the document.

How can I solve this?

Thanks Henrik.
 
S

Steven Cheng[MSFT]

Hi Henrik,

Welcome to msdn newsgroup.
As for the new managed WEbBrowser control in .NET framework 2.0, it is
still used to navigating file based documents, so there must exists an
phyisical file on the disk or over network url to let it navigate.... We
can not directly assign an in-memory document or stream ot it... So for
your scenario, I think you can consider creating a temp file to store the
in-memory XML stream and then let the webbrowser control navigate to that
temp file to display them, this is the most commonly used approach so far.

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


--------------------
| From: "Henrik Skak Pedersen" <[email protected]>
| Subject: How do I display XML in the new .NET 2.0 WebBrowser control
| Date: Tue, 13 Dec 2005 21:05:01 +0100
| Lines: 13
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| X-RFC2646: Format=Flowed; Original
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.windowsforms
| NNTP-Posting-Host: 80.63.142.94
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.windowsforms:91948
| X-Tomcat-NG: microsoft.public.dotnet.framework.windowsforms
|
| Hi,
|
| I would like to show XML in the new builtin WebBrowser control. I have
the
| xml in a string.
|
| I am trying to set the DocumentText property to my xml text. But the
control
| only shows the values and not the document.
|
| How can I solve this?
|
| Thanks Henrik.
|
|
|
 
C

Charles Law

Hi Henrik

You might like to ask this in

microsoft.public.inetsdk.programming.webbrowser_ctl

as the question is generally applicable to the WebBrowser control, and
doesn't just relate to the one in VS2005.

Charles
 
T

tdavisjr

Charles,

The WebBrowser control is a new managed component in .NET 2.0. So, in
my opinion, this does relates to this group. You may be referring to
the old COM based web browser control. Either way, Steven most likely
gave the solution to this issue.
 
C

Charles Law

You are right to say that this is a managed component, but it is still the
same old mshtml and shdocvw underneath; the same as the ActiveX WebBrowser
control. The managed bit is just a hand-crafted wrapper, as opposed to the
automatically generated AxHost wrapper that VS2002/3 generate. In that
respect, an answer to the original question could be equally applicable to
the control in VS2002/3 and VS 2005. That is why I suggested the other
newsgroup, because there are people who live there with a great deal of
knowledge and experience of the core components.

Charles
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top