I know we can use Response.Add_Header() to add a header to a response (though I don't really understand how to use it), but can we CHANGE the response header? Here is my situation.
I have a page that makes an asynchronous call to another page called events.a5w. This page then takes the date passed in the call and filters the event.dbf table to events on that date. Then it loops through the records and prints them to the screen (using ?) as xml. The only problem is that this returns a content type of text/html. I need to change it to text/xml in order to make my program work. How do I do this?
Here is the code for the events.a5w page:
Howard
I have a page that makes an asynchronous call to another page called events.a5w. This page then takes the date passed in the call and filters the event.dbf table to events on that date. Then it loops through the records and prints them to the screen (using ?) as xml. The only problem is that this returns a content type of text/html. I need to change it to text/xml in order to make my program work. How do I do this?
Here is the code for the events.a5w page:
Code:
<html> <head> <meta name="generator" content="Alpha Five HTML Editor"> <title>Event Data Getter</title> </head> <body> <%a5 dim tbl as p tbl = table.open("[PathAlias.ADB_Path]\event.dbf",FILE_RO_SHARED) query.order = "" query.filter = "Date = {" + eventDate + "}" query.options = "MTN" qry = tbl.query_create() if qry.records_get() > 0 then ? "<?xml version=\"1.0\" encoding=\"utf-8\"?>" ? "<events>" ? "<total-records>"+qry.records_get()+"</total-records>" else 'no data ? "No data found." end if tbl.fetch_first() while .not. tbl.fetch_eof() ? " <record>" ? " <eventid>"+tbl.Event_id+"</eventid>" ? " <sponsorid>"+tbl.Sponsor_id+"</sponsorid>" ? " <townid>"+tbl.Town_id+"</townid>" ? " <countyid>"+tbl.County_id+"</countyid>" ? " <catid>"+tbl.Cat_id+"</catid>" ? " <date>"+tbl.Date+"</date>" ? " <time>"+tbl.Time+"</time>" ? " <description>"+tbl.Description+"</description>" ? " </record>" tbl.fetch_next() end while ? "</events>" qry.drop() tbl.close() %> </body></html>
Comment