views:

109

answers:

2

Hello,

I've used xml type by writing (asp coding)

Response.ContentType = "text/xml"

Now xml contents are over and I'd like to add html content so I wrote

Response.ContentType = "text/html"

But it still writing in xml what would be the problem here?

+2  A: 

I'm not sure what you mean. There can only be one ContentType per response. The browser will interpret the whole content of the response as xml.

If you want to get two files with different content types, you'll have to call them separately.

splattne
so should I make another ajax call?
Vikas
Yes, you need to make another ajax call, or however the page is being downloaded.
Matthew Scharley
A: 

As @splattne already stated, a single Response from the server can have only a single content-type. You cannot have separate types unless you initiate a second request from the client (and have a way of determining that this request requires a different accept type). A better way is to send the second request to a different function/resource.

Cerebrus