ASPForums.Net RSS Feedhttp://www.aspforums.net/Handlers/RSS.ashxLatest additions to the content that appears on ASPForums.Net(c) 2017 www.aspforums.com. All rights reserved.How to get the Table Header when webmethod returning XML string using Ajax jQueryHi @zzz,<br />Please try the following<br /><br /><a href = 'link(Threads/140242/Solved-Unable-to-get-selected-value-of-ASPNet-DropDownList-Populated-using-jQuery-AJAX-on-Sever-Side/)'>[Solved] Unable to get selected value of ASP.Net DropDownList Populated using jQuery AJAX on Sever Side</a><br /><br />It might help you.<br /><br />Cheers Andrea.http://www.aspforums.net/Threads/530577/How-to-get-the-Table-Header-when-webmethod-returning-XML-string-using-Ajax-jQuery/http://www.aspforums.net/Threads/530577/How-to-get-the-Table-Header-when-webmethod-returning-XML-string-using-Ajax-jQuery/Wed, 16 Nov 2016 02:12:55 GMTHow to get the Table Header when webmethod returning XML string using Ajax jQuery<blockquote><cite>zzz says:</cite> <div class="line number10 index9 alt1"><code class="js spaces">&nbsp;</code><code class="js plain">$.each(customers, </code><code class="js keyword">function</code> <code class="js plain">() {</code></div> <div class="line number11 index10 alt2"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js keyword">var</code> <code class="js plain">customer = $(</code><code class="js keyword">this</code><code class="js plain">);</code></div> <div class="line number12 index11 alt1"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js plain">$(</code><code class="js string">"td"</code><code class="js plain">, row).eq(0).html($(</code><code class="js keyword">this</code><code class="js plain">).find(</code><code class="js string">"ContactName"</code><code class="js plain">).text());</code></div> <div class="line number13 index12 alt2"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js plain">$(</code><code class="js string">"td"</code><code class="js plain">, row).eq(1).html($(</code><code class="js keyword">this</code><code class="js plain">).find(</code><code class="js string">"CustomerID"</code><code class="js plain">).text());</code></div> <div class="line number14 index13 alt1"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js plain">$(</code><code class="js string">"td"</code><code class="js plain">, row).eq(2).html($(</code><code class="js keyword">this</code><code class="js plain">).find(</code><code class="js string">"City"</code><code class="js plain">).text());</code></div> <div class="line number15 index14 alt2"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js plain">$(</code><code class="js string">"[id*=gvCustomers]"</code><code class="js plain">).append(row);</code></div> <div class="line number16 index15 alt1"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js plain">row = $(</code><code class="js string">"[id*=gvCustomers] tr:last-child"</code><code class="js plain">).clone(</code><code class="js keyword">true</code><code class="js plain">);</code></div> <div class="line number17 index16 alt2"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js plain">});</code></div> </blockquote> <p>&nbsp;replace above code with below</p> <pre class="brush: js">$.each(customers, function () { var headerContactName = $(this).find(&#34;ContactName&#34;)[0].nodeName; // Header for ContactName. var headerCustomerID = $(this).find(&#34;CustomerID&#34;)[0].nodeName; // Header for CustomerID. var headerCity = $(this).find(&#34;City&#34;)[0].nodeName; // Header for headerCity. var customer = $(this); $(&#34;td&#34;, row).eq(0).html($(this).find(&#34;CustomerID&#34;).text()); $(&#34;td&#34;, row).eq(1).html($(this).find(&#34;ContactName&#34;).text()); $(&#34;td&#34;, row).eq(2).html($(this).find(&#34;City&#34;).text()); $(&#34;[id*=gvCustomers]&#34;).append(row); row = $(&#34;[id*=gvCustomers] tr:last-child&#34;).clone(true); });</pre> <p>&nbsp;</p>http://www.aspforums.net/Threads/530577/How-to-get-the-Table-Header-when-webmethod-returning-XML-string-using-Ajax-jQuery/http://www.aspforums.net/Threads/530577/How-to-get-the-Table-Header-when-webmethod-returning-XML-string-using-Ajax-jQuery/Wed, 16 Nov 2016 02:40:40 GMTHow to get the Table Header when webmethod returning XML string using Ajax jQuery<p>This one helps me,</p> <p><a href="http://www.aspsnippets.com/Articles/Display-Show-XML-string-data-on-HTML-page-in-Table-format-using-JavaScript-and-jQuery.aspx" target="_blank">http://www.aspsnippets.com/Articles/Display-Show-XML-string-data-on-HTML-page-in-Table-format-using-JavaScript-and-jQuery.aspx</a></p>http://www.aspforums.net/Threads/530577/How-to-get-the-Table-Header-when-webmethod-returning-XML-string-using-Ajax-jQuery/http://www.aspforums.net/Threads/530577/How-to-get-the-Table-Header-when-webmethod-returning-XML-string-using-Ajax-jQuery/Wed, 16 Nov 2016 20:21:48 GMT