Newbie Question.

D

DamFoo

Hello,

I loved how simple it was to load a basic XML file using this code:

<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="iso-8859-1"
Debug="true" %>
<html>
<body>
<asp:Xml DocumentSource="../code/test.xml" runat="server" Visible="true" />
</body>
</html>

Problem is, it only works with files locally available. If I wanted to do
this:

<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="iso-8859-1"
Debug="true" %>
<html>
<body>
<asp:Xml DocumentSource="http://www.thirdopartyserver.com/code/test.xml"
runat="server" Visible="true" />
</body>
</html>

I get an error telling me I should be using a virtual path.

Does anyone have a piece of code which will do the same as above, only with
a third party server hosted XML file?

Regards,

Gary.
 
J

John Timney \(MVP\)

To add to Marks suggestion, take a look at the dataset method ReadXML which
allows you to bind a remote URL based XML file directly to any bindable
object like a datagrid

ds = new DataSet();
ds.ReadXml(URLpath, XmlReadMode.Auto);

--
--
Regards

John Timney (MVP)
VISIT MY WEBSITE:
http://www.johntimney.com
 

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

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top