IE saving popup window. Why it will not be show the "MHT" as thedefault option after i submit the da

B

Benny Ng

Dear All,


In the following source. If we don't submit the data in the same page.
Then the function for save will be working fine. it will save the page to
mht extension automatically. (please see the combo box of file extension..)

but i don't know why, once i submit the data to self page. and click the
save button again. Then the popup box will not show "mht" extension as the
default extension. (now it will shows the "HTML" as the default option in
the extension combo box.).

could any body can helps me to fix it? or it's a bug for IE?


Please check the following source:



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
</HEAD>
<form id='form1' name='form1' method='post' action='mht.asp'>
<input type=button name='btntest' value='test' onclick='jsmht();'>
<input type=submit name='btnsubmit' value='submit'>
</form>
<BODY>
<SCRIPT LANGUAGE="JavaScript">
<!--
function jsmht()
{
window.document.title = 'good';
var OLECMDID_SAVEAS = 4;
var OLECMDEXECOPT_DONTPROMPTUSER = 2;
var OLECMDEXECOPT_PROMPTUSER = 1;
var WebBrowser = "<OBJECT ID=\"WebBrowser2\" WIDTH=0 HEIGHT=0
CLASSID=\"CLSID:8856F961-340A-11D0-A96B-00C04FD705A2\"></OBJECT>";
document.body.insertAdjacentHTML("beforeEnd", WebBrowser);
WebBrowser2.ExecWB(OLECMDID_SAVEAS, OLECMDEXECOPT_PROMPTUSER);
WebBrowser2.outerHTML = "";
}
//-->
</SCRIPT>
</BODY>
</HTML>


Thanks and Best Regards,

Benny Ng
 
B

bruce barker

after postback, the page name is mht.asp, thus the new extention. change the
postback extension to mht (just map the mht extention to asp and rename the
asp page.)

-- bruce (sqlwork.com)
 
B

Benny Ng

Dear Bruce,

Thanks for your answer. But I still don't know how to fix the source of
mine.

Maybe I still don't understand what's the meaning on your answer.

I don't know this statement:

//////////////////
change the postback extension to mht (just map the mht extention to asp
and rename the asp page.)
//////////////////

Could you help me again? :(....

I'm really sorry for that.

Best Regards,

Benny Ng
 
Top