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

Discussion in 'ASP .Net' started by Benny Ng, Feb 22, 2008.

  1. Benny Ng

    Benny Ng Guest

    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
    Benny Ng, Feb 22, 2008
    #1
    1. Advertising

  2. Benny Ng

    bruce barker Guest

    RE: IE saving popup window. Why it will not be show the "MHT" as the d

    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)


    "Benny Ng" wrote:

    > 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
    >
    bruce barker, Feb 22, 2008
    #2
    1. Advertising

  3. Benny Ng

    Benny Ng Guest

    Re: IE saving popup window. Why it will not be show the "MHT" as thed

    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

    On Sat, 23 Feb 2008 00:27:02 +0800, bruce barker
    <> wrote:

    > 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)
    >
    >
    > "Benny Ng" wrote:
    >
    >> 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
    >>




    --
    Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
    Benny Ng, Feb 23, 2008
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    2
    Views:
    6,151
  2. Mr. SweatyFinger
    Replies:
    2
    Views:
    1,671
    Smokey Grindel
    Dec 2, 2006
  3. Albert Schlef

    Saving HTML as MHT

    Albert Schlef, Jul 19, 2010, in forum: Ruby
    Replies:
    2
    Views:
    221
    Colin Bartlett
    Jul 19, 2010
  4. Replies:
    2
    Views:
    332
  5. Gabriella

    Cannot close popup window after submit

    Gabriella, Jan 22, 2007, in forum: Javascript
    Replies:
    4
    Views:
    448
Loading...

Share This Page