I have a file (viewdoc) which writes a .mht file to the screen. In my application I have two main divs: one for the menu (= treeview) and one div to 开发者_Go百科display the .mht file (#documentContent).
My menu calls a javascript function which performs an ajax request to viewdoc and put the output of viewdoc in my content div (#documentContent):
function loadDocument(id, doc) {
$("#documentContent").load('viewdoc.aspx?id=' + id + '&doc=' + doc + '');
}
The problem is, in the #documentContent div, the content isn't parsed as .mht. But when I call viewdoc directly from the browser, the content is displayed correctly.
In viewdoc.aspx I set the content type:
Response.ContentType = "message/rfc822";
Response.ContentEncoding = Encoding.UTF8;
Isn't it possible to display two content types on one 1 page? Or what is the problem here?
No, you can't set 2 contenttypes for 1 page.
And your code will never be parsed as mht in some div. It is html :) All you can do - use iframe or use other format of viewdoc.aspx
精彩评论