Last post Apr 10, 2012 08:39 AM by kuber.manral
Apr 09, 2012 10:20 AM|newbie2C#|LINK
I'm trying to concatenate two nodes with a pspace between them. They are First_Name & Last_Name. I tried the code below but it broke the bidning completely.
Text='<%# XPath("/people/person/@First_Name" + " " + "/people/person/@Last_Name" )
Apr 10, 2012 08:16 AM|kavita_khandhadia|LINK
Lets say you have an XML at XML/Customers.xml path.
On the server side if you write this.
XDocument xCustomers = XDocument.Load(Server.MapPath("XML//Customers.xml"));
IEnumerable<XElement> customer= (from en in xCustomers.Descendants("Customer")
foreach (XElement xE in customer)
txtXML.Text = xE.Element("FirstName").Value + " " + xE.Element("SurName").Value;
It should work.
This is not very good approch, but as your query is ver raw, this is what I can provide you with.
Apr 10, 2012 08:39 AM|kuber.manral|LINK
This seems to target the Wrong XPath. If you want to pick First Name and Last Name both with a space, you should pick them seperately. I mean you should provide Xpath as a whole for each and then merger them later.
Hope it helps...