Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Ideally you would use an ashx to send XML although I do allow code in an ASPX to intercept normal execution.</p> <pre><code>Response.Clear() </code></pre> <p>I don't use this if you not sure you've dumped anything in the response already the go find it and get rid of it.</p> <pre><code>Response.ContentType = "text/xml" </code></pre> <p>Definitely, a common client will not accept the content as XML without this content type present.</p> <pre><code> Response.Charset = "UTF-8"; </code></pre> <p>Let the response class handle building the content type header properly. Use UTF-8 unless you have a really, really good reason not to.</p> <pre><code>Response.Cache.SetCacheability(HttpCacheability.NoCache); Response.Cache.SetAllowResponseInBrowserHistory(true); </code></pre> <p>If you don't send cache headers some browsers (namely IE) will cache the response, subsequent requests will not necessarily come to the server. You also need to AllowResponseInBrowser if you want this to work over HTTPS (due to yet another bug in IE).</p> <p>To send content of an XmlDocument simply use:</p> <p><strike></p> <pre><code>dom.Save(Response.OutputStream); </code></pre> <p></strike></p> <pre><code>dom.Save(Response.Output); </code></pre> <p>Just be sure the encodings match, (another good reason to use UTF-8).</p> <p>The <code>XmlDocument</code> object will automatically adjust its embedded <code>encoding="..."</code> encoding to that of the <code>Response</code> (e.g. <code>UTF-8</code>)</p> <pre><code>Response.End() </code></pre> <p>If you really have to in an ASPX but its a bit drastic, in an ASHX don't do it.</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.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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