I have a page that is invoked as
that does this:
Protected Sub Page_Load(ByVal sender As Object, _
ByVal e As System.EventArgs)
Dim ThisId As String = Request.QueryString("id")
Dim Doc As XmlDocument = GenerateData(ThisId)
Response.Buffer = True
Response.ContentType = "text/xml"
object containing data retrieved using the query string parameter
My problem is that if the URL has a query string, the returned document is treated by the browser as ill-formatted HTML. If I omit the query string and pass a hard coded constant into
, the returned document is treated like an XML document and displays exactly as I would expect.
I have tried
, and both generate a "Collection is read-only" error.
I would like to retain the flexibility of passing the search criteria through the query string and not have to deal with the
object or form submissions. Any suggestions on how to get this to work?ADDED
For what it is worth, this is the XML that gets generated whether I use the query string or an inline constant:
<EBulletinDate>6/9/2010 12:00:00 AM</EBulletinDate>
With the constant, this is displayed by the browser (IE 8, at least) as a well-formatted XML file. With the query string, this same file is displayed as if it were badly-formatted HTML.Solution
Boy, do I feel like a right idiot. I added the
directive to the page, and suddenly the problem went away. Apparently, the query string version had been cached with some non-obvious errors, and it was this version that the server was returning. :doh:
Never mind, nothing to see here.