Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to return XML in ASP.NET
    primarykey
    data
    text
    <p>This is a very basic question. I'm just on my mission to learn ASP.NET (C#). I've done classic ASP and PHP before.</p> <p>For this project I have <strong>ASP.NET 2.0</strong> at my hands.</p> <p>I have a Web Form that has a <a href="http://www.trirand.com/blog/" rel="nofollow noreferrer">jqGrid</a> Datagrid that I want to feed XML data via AJAX. jqGrid is not the problem here, though. The "problem" is the approach that I should take to generate the XML.</p> <p>How do I do that in ASP.NET?</p> <ul> <li>Do I create a new Web Form that generates that data?</li> <li>Do I use a new Web Service (that would not return the XML I need, would it?)?</li> <li>Do I somehow put a function in the existing Web Form that shows the table? If so, how?</li> </ul> <p>After that decision is made: How do I output the XML? I don't want to use any XML components of ASP.NET, because it's just plain, simplistic XML with one record after each other. Using System.Xml would be too much overhead to be justified here.</p> <pre><code>&lt;?xml version='1.0' encoding='utf-8'?&gt; &lt;rows&gt; &lt;page&gt;1&lt;/page&gt; &lt;total&gt;25&lt;/total&gt; &lt;records&gt;3&lt;/records&gt; &lt;row id='1'&gt; &lt;cell&gt;Row 1, Column 1&lt;/cell&gt; &lt;cell&gt;Row 1, Column 2&lt;/cell&gt; &lt;cell&gt;Row 1, Column 3&lt;/cell&gt; &lt;/row&gt; &lt;row id='2'&gt; &lt;cell&gt;Row 2, Column 1&lt;/cell&gt; &lt;cell&gt;Row 2, Column 2&lt;/cell&gt; &lt;cell&gt;Row 2, Column 3&lt;/cell&gt; &lt;/row&gt; &lt;row id='3'&gt; &lt;cell&gt;Row 3, Column 1&lt;/cell&gt; &lt;cell&gt;Row 3, Column 2&lt;/cell&gt; &lt;cell&gt;Row 3, Column 3&lt;/cell&gt; &lt;/row&gt; &lt;/rows&gt; </code></pre> <p>From my previous experience with the other scripting languages, I'd just like to print out a stream of XML tags (Response.Write). Will I go to hell if I do so in ASP.NET?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload