1

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 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?

VMAtm
  • 27,943
  • 17
  • 79
  • 125
Martijn
  • 24,441
  • 60
  • 174
  • 261

1 Answers1

1

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

VMAtm
  • 27,943
  • 17
  • 79
  • 125
  • Thnx, I used to use an iframe, but I didn't like it, but I've implemented again, sice there's no other way. Thanx for the answer :) – Martijn May 26 '10 at 08:17