| Page 1 of 1 | [ 3 posts ] |
|
Data: which is from aspx page. getting the dataset and using folllowing code
string s = ds.GetXml(); Response.ContentType = "text/xml"; Response.Write("<?xml version=\"1.0\"?> "); Response.Write(s); Response.End(); and am getting the following response in aspx page. <?xml version="1.0" ?> - <NewDataSet> - <Table> <ID>1</ID> <FName>XXX</FName> <LName>I</LName> </Table> - <Table> <ID>2</ID> <FName>Naresh</FName> <LName>K</LName> </Table> - <Table> <ID>3</ID> <FName>Tirumal</FName> <LName>R</LName> </Table> - <Table> <ID>4</ID> <FName>Tirupathi</FName> <LName>E</LName> </Table> - <Table> <ID>5</ID> <FName>Raju</FName> <LName>K</LName> </Table> </NewDataSet> Script: YAHOO.util.Event.addListener(window, "load", function() { YAHOO.example.XHR_XML = function() { var myColumnDefs = [ {key:"ID", label:"ID", sortable:true}, {key:"FName", label:"FName", sortable:true}, {key:"LName", label:"LName", sortable:true} ]; var myDataSource = new YAHOO.util.DataSource("http://localhost:3471/products-w3cdom.xml"); myDataSource.connMethodPost = true; myDataSource.responseType = YAHOO.util.DataSource.TYPE_XML; myDataSource.useXPath = true; myDataSource.responseSchema = { resultNode: 'Product', fields: [{key:'ID'},{key:'FName'},{key:'LName'}] }; var myDataTable = new YAHOO.widget.DataTable("xml", myColumnDefs, myDataSource); return { oDS: myDataSource, oDT: myDataTable }; }(); }); Html container: <div id="xml"></div> from html page with the above script am getting "DataError". Help me in this where am going wrong. |
|
your problem is the resultNode. you have no node "Product" in your xml answer.
change it to table and try again. |
|
I have done the changes but am getting the same error.
I got it. Actually the request is not going to the aspx page. i missed connection-min.js in ref section. |
| Page 1 of 1 | [ 3 posts ] |
| You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group