I am trying to pass an XML list to a view but I am having trouble once I get to the view.
My controller:
public ActionResult Search(int isbdn) { ViewData['ISBN'] = isbdn; string pathToXml= 'http://isbndb.com/api/books.xml?access_key=DWD3TC34&index1=isbn&value1='; pathToXml += isbdn; var doc = XDocument.Load(pathToXml); IEnumerable<XElement> items = from m in doc.Elements() select m;
What would my view look like? Do I need to incorporate some type of XML data controller?
first.. you have to return the data to the view modal…
in your code behind you have to inherit
and than your ViewData.Modal will be a strongly typed
IEnumerable<XElement>. and you will be able to work with data as in the controller.