how to concatenate two node?http://forums.asp.net/t/1790794.aspx/1?how+to+concatenate+two+node+Tue, 10 Apr 2012 12:39:13 -040017907944923159http://forums.asp.net/p/1790794/4923159.aspx/1?how+to+concatenate+two+node+how to concatenate two node? <p>I'm trying to concatenate two nodes with a pspace between them.&nbsp; They are First_Name &amp; Last_Name. I tried the code below but it broke the bidning completely.</p> <pre class="prettyprint">Text='&lt;%# XPath(&quot;/people/person/@First_Name&quot; &#43; &quot; &quot; &#43; &quot;/people/person/@Last_Name&quot; )</pre> <p><br> &nbsp;</p> 2012-04-09T14:20:12-04:004924880http://forums.asp.net/p/1790794/4924880.aspx/1?Re+how+to+concatenate+two+node+Re: how to concatenate two node? <p>Lets say you have an XML at XML/Customers.xml path.<br> <br> Customer.xml<br> <br> &lt;Customers&gt;<br> &nbsp; &lt;Customer&gt;<br> &nbsp;&nbsp;&nbsp; &lt;FirstName&gt;Kavita&lt;/FirstName&gt;<br> &nbsp;&nbsp;&nbsp; &lt;SurName&gt;Khandhadia&lt;/SurName&gt;&nbsp;&nbsp; &nbsp;<br> &nbsp; &lt;/Customer&gt;<br> &lt;/Customers&gt;<br> <br> <br> On the server side if you write this.<br> <br> XDocument xCustomers = XDocument.Load(Server.MapPath(&quot;XML//Customers.xml&quot;));&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IEnumerable&lt;XElement&gt; customer= (from en in xCustomers.Descendants(&quot;Customer&quot;)<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; select en<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; );<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; foreach (XElement xE in customer)<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; txtXML.Text = xE.Element(&quot;FirstName&quot;).Value &#43; &quot; &quot; &#43; xE.Element(&quot;SurName&quot;).Value;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br> <br> It should work.<br> <br> This is not very good approch, but as your query is ver raw, this is what I can provide you with.</p> 2012-04-10T12:16:19-04:004924941http://forums.asp.net/p/1790794/4924941.aspx/1?Re+how+to+concatenate+two+node+Re: how to concatenate two node? <p>Hi newbie2C#,</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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.</p> <p>Hope it helps...</p> 2012-04-10T12:39:13-04:00