NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: Thys on January 26, 2012, 04:17:55 AM

Title: ReplyContentType
Post by: Thys on January 26, 2012, 04:17:55 AM
Hi,

I have a page that can return either html, xml or plain text. The header can be set up to contain the reply content type in this way:

p_web.ReplyContentType = 'text/html'

for html, and similarly 'text/xml' for xml and 'text/plain' for plain text.

The page is a NetWebPage procedure that contains no controls. In the Processed Code embed I then set ReplyContentType to the required type and then setup the packet variable.

But it seems to have no effect. When the content is XML it doesn't display the text but View Source shows it all. Seems like content type is not properly set in this way.

Thanks
Title: Re: ReplyContentType
Post by: Bruce on January 26, 2012, 07:32:42 AM
I'd do it like this;

a) NetWebPage Settings
Set "Page Type" to "Other"
Set content type to (say) loc:ContentType

b) Right-click and go to the source for the procedure.
create a variable loc:ContentType String(255)
search for where loc:ContentType is used
and set it to the correct value in the embed before that.

Cheers
Bruce
Title: Re: ReplyContentType
Post by: Thys on January 26, 2012, 11:18:38 PM
Thanks Bruce.