By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,182 Members | 1,422 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,182 IT Pros & Developers. It's quick & easy.

Trying to read XML stream from browser

P: 4
Hi, I'm writing a String containing XML data to my browser. The XML data is well formed and the page opens up correctly but when I try to read this data from another page I get the following error: '>' is an unexpected token. The expected token is '"' or '''. Line 2, position 63.

Here is the code in the page serving the XML:

Response.Clear();
Response.ClearContent();
Response.ClearHeaders();

Response.ContentType = "text/xml";
Response.ContentEncoding = Encoding.UTF8;
String returnXML = "<LIST><ITEM><CODE>24</CODE></ITEM></LIST>";
Response.Write(returnXML);

When I hit the above page directly there are no issues and the XML is displayed nicely in a tree.



Here is the code from the page trying to read the XML data:

DataSet dataSet = new DataSet();
dataSet.ReadXml("http://localhost:2593/MyApp/EmitXMLToBrowser.aspx");
this.GridView1.DataSource = dataSet;
this.GridView1.DataMember = "ITEM";
this.GridView1.DataBind();


thats when I get the following error: '>' is an unexpected token. The expected token is '"' or '''. Line 2, position 63.

Note: if I try to save returnXML to a file and read that file in dataSet.ReadXML, there are no issues.

Any idea what is the issue here?

Thanks
Jan 15 '08 #1
Share this Question
Share on Google+
1 Reply


P: 4
Ok, I know what is causing the error. In the web.config file if I replace
<authentication mode="Forms">
<forms name="LOGINFORM" loginUrl="login.aspx" protection="All" timeout="60" />
</authentication>
<authorization>
<deny users="?" />
</authorization>

with <authentication mode="Windows"/>

it works fine!!!

I do need forms authentication, any idea how to get this to work?

Thanks
Jan 15 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.