Open Word Document from a Dialog Web Page

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Peter

    Open Word Document from a Dialog Web Page

    ASP.NET 2.0

    I am trying to open a Word document and Excel document from a dialog web
    page, what's the best way to do that?

    I have tried the following:

    Response.Clear( );
    Response.AddHea der("Content-Disposition", "attachment ; filename=" +
    file.Name);
    Response.AddHea der("Content-Length", file.Length.ToS tring());
    Response.Conten tType = "applicatio n/octet-stream";
    Response.WriteF ile(file.FullNa me);
    Response.End();


    but I am getting the following error message.

    Unable to evaluate expression because the code is optimized or a native
    frame is on top of the call stack.


    Thank You


    Peter


  • Steven Cheng [MSFT]

    #2
    RE: Open Word Document from a Dialog Web Page

    Hi Peter,

    Regarding on the open excel file in dialog page issue, would you provide
    some further information such as how to open the dialog page and whether
    the dialog page's url is the page that write out excel file or if the
    dialog page want to open another page that write out excel file?

    Based on my understanding, if the dialog page directy point to the excel
    page, it may cause problem due to the client-side browser's dialog model.
    Is there any particular requirement that you need to open excel file in
    dialog pgae?

    Sincerely,

    Steven Cheng

    Microsoft MSDN Online Support Lead


    Delighting our customers is our #1 priority. We welcome your comments and
    suggestions about how we can improve the support we provide to you. Please
    feel free to let my manager know what you think of the level of service
    provided. You can send feedback directly to my manager at:
    msdnmg@microsof t.com.

    =============== =============== =============== =====
    Get notification to my posts through email? Please refer to
    Gain technical skills through documentation and training, earn certifications and connect with the community

    ications.

    =============== =============== =============== =====
    This posting is provided "AS IS" with no warranties, and confers no rights.

    --------------------
    >From: "Peter" <czupet@nospam. nospam>
    >Subject: Open Word Document from a Dialog Web Page
    >Date: Wed, 30 Apr 2008 23:00:55 -0500
    >
    >ASP.NET 2.0
    >
    >I am trying to open a Word document and Excel document from a dialog web
    >page, what's the best way to do that?
    >
    >I have tried the following:
    >
    >Response.Clear ();
    >Response.AddHe ader("Content-Disposition", "attachment ; filename=" +
    >file.Name);
    >Response.AddHe ader("Content-Length", file.Length.ToS tring());
    >Response.Conte ntType = "applicatio n/octet-stream";
    >Response.Write File(file.FullN ame);
    >Response.End() ;
    >
    >
    >but I am getting the following error message.
    >
    >Unable to evaluate expression because the code is optimized or a native
    >frame is on top of the call stack.
    >
    >
    >Thank You
    >
    >
    >Peter
    >
    >
    >

    Comment

    • Peter

      #3
      Re: Open Word Document from a Dialog Web Page

      I have a dialog page and on that page is a submitt button, when a user
      clicks on the submit button I want to open a Word or Excel file.
      The Word or Excel file already exitst on the web server.

      "Steven Cheng [MSFT]" <stcheng@online .microsoft.comw rote in message
      news:7k7oiY2qIH A.1784@TK2MSFTN GHUB02.phx.gbl. ..
      Hi Peter,
      >
      Regarding on the open excel file in dialog page issue, would you provide
      some further information such as how to open the dialog page and whether
      the dialog page's url is the page that write out excel file or if the
      dialog page want to open another page that write out excel file?
      >
      Based on my understanding, if the dialog page directy point to the excel
      page, it may cause problem due to the client-side browser's dialog model.
      Is there any particular requirement that you need to open excel file in
      dialog pgae?
      >
      Sincerely,
      >
      Steven Cheng
      >
      Microsoft MSDN Online Support Lead
      >
      >
      Delighting our customers is our #1 priority. We welcome your comments and
      suggestions about how we can improve the support we provide to you. Please
      feel free to let my manager know what you think of the level of service
      provided. You can send feedback directly to my manager at:
      msdnmg@microsof t.com.
      >
      =============== =============== =============== =====
      Get notification to my posts through email? Please refer to
      Gain technical skills through documentation and training, earn certifications and connect with the community

      ications.
      >
      =============== =============== =============== =====
      This posting is provided "AS IS" with no warranties, and confers no
      rights.
      >
      --------------------
      >>From: "Peter" <czupet@nospam. nospam>
      >>Subject: Open Word Document from a Dialog Web Page
      >>Date: Wed, 30 Apr 2008 23:00:55 -0500
      >
      >>
      >>ASP.NET 2.0
      >>
      >>I am trying to open a Word document and Excel document from a dialog web
      >>page, what's the best way to do that?
      >>
      >>I have tried the following:
      >>
      >>Response.Clea r();
      >>Response.AddH eader("Content-Disposition", "attachment ; filename=" +
      >>file.Name);
      >>Response.AddH eader("Content-Length", file.Length.ToS tring());
      >>Response.Cont entType = "applicatio n/octet-stream";
      >>Response.Writ eFile(file.Full Name);
      >>Response.End( );
      >>
      >>
      >>but I am getting the following error message.
      >>
      >>Unable to evaluate expression because the code is optimized or a native
      >>frame is on top of the call stack.
      >>
      >>
      >>Thank You
      >>
      >>
      >>Peter
      >>
      >>
      >>
      >

      Comment

      • S.M. Altaf [MVP]

        #4
        Re: Open Word Document from a Dialog Web Page

        Are you attempting to execute any code after the Response.End()?

        --
        ---------------------------------------------------
        S.M. Altaf [MVP]



        "Peter" <czupet@nospam. nospamwrote in message
        news:Om7IoI4qIH A.3616@TK2MSFTN GP06.phx.gbl...
        I have a dialog page and on that page is a submitt button, when a user
        clicks on the submit button I want to open a Word or Excel file.
        The Word or Excel file already exitst on the web server.
        >
        "Steven Cheng [MSFT]" <stcheng@online .microsoft.comw rote in message
        news:7k7oiY2qIH A.1784@TK2MSFTN GHUB02.phx.gbl. ..
        >Hi Peter,
        >>
        >Regarding on the open excel file in dialog page issue, would you provide
        >some further information such as how to open the dialog page and whether
        >the dialog page's url is the page that write out excel file or if the
        >dialog page want to open another page that write out excel file?
        >>
        >Based on my understanding, if the dialog page directy point to the excel
        >page, it may cause problem due to the client-side browser's dialog model.
        >Is there any particular requirement that you need to open excel file in
        >dialog pgae?
        >>
        >Sincerely,
        >>
        >Steven Cheng
        >>
        >Microsoft MSDN Online Support Lead
        >>
        >>
        >Delighting our customers is our #1 priority. We welcome your comments and
        >suggestions about how we can improve the support we provide to you.
        >Please
        >feel free to let my manager know what you think of the level of service
        >provided. You can send feedback directly to my manager at:
        >msdnmg@microsof t.com.
        >>
        >============== =============== =============== ======
        >Get notification to my posts through email? Please refer to
        >http://msdn.microsoft.com/subscripti...ult.aspx#notif
        >ications.
        >>
        >============== =============== =============== ======
        >This posting is provided "AS IS" with no warranties, and confers no
        >rights.
        >>
        >--------------------
        >>>From: "Peter" <czupet@nospam. nospam>
        >>>Subject: Open Word Document from a Dialog Web Page
        >>>Date: Wed, 30 Apr 2008 23:00:55 -0500
        >>
        >>>
        >>>ASP.NET 2.0
        >>>
        >>>I am trying to open a Word document and Excel document from a dialog web
        >>>page, what's the best way to do that?
        >>>
        >>>I have tried the following:
        >>>
        >>>Response.Cle ar();
        >>>Response.Add Header("Content-Disposition", "attachment ; filename=" +
        >>>file.Name) ;
        >>>Response.Add Header("Content-Length", file.Length.ToS tring());
        >>>Response.Con tentType = "applicatio n/octet-stream";
        >>>Response.Wri teFile(file.Ful lName);
        >>>Response.End ();
        >>>
        >>>
        >>>but I am getting the following error message.
        >>>
        >>>Unable to evaluate expression because the code is optimized or a native
        >>>frame is on top of the call stack.
        >>>
        >>>
        >>>Thank You
        >>>
        >>>
        >>>Peter
        >>>
        >>>
        >>>
        >>
        >
        >

        Comment

        • Peter

          #5
          Re: Open Word Document from a Dialog Web Page

          Yes, but the error occurs on the Response.End();

          "S.M. Altaf [MVP]" <smaltaf@mNOSPA Msn.comwrote in message
          news:AFCD26C4-B9B5-4CE3-BDE3-F674342DF778@mi crosoft.com...
          Are you attempting to execute any code after the Response.End()?
          >
          --
          ---------------------------------------------------
          S.M. Altaf [MVP]

          >
          >
          "Peter" <czupet@nospam. nospamwrote in message
          news:Om7IoI4qIH A.3616@TK2MSFTN GP06.phx.gbl...
          >I have a dialog page and on that page is a submitt button, when a user
          >clicks on the submit button I want to open a Word or Excel file.
          >The Word or Excel file already exitst on the web server.
          >>
          >"Steven Cheng [MSFT]" <stcheng@online .microsoft.comw rote in message
          >news:7k7oiY2qI HA.1784@TK2MSFT NGHUB02.phx.gbl ...
          >>Hi Peter,
          >>>
          >>Regarding on the open excel file in dialog page issue, would you provide
          >>some further information such as how to open the dialog page and whether
          >>the dialog page's url is the page that write out excel file or if the
          >>dialog page want to open another page that write out excel file?
          >>>
          >>Based on my understanding, if the dialog page directy point to the excel
          >>page, it may cause problem due to the client-side browser's dialog
          >>model.
          >>Is there any particular requirement that you need to open excel file in
          >>dialog pgae?
          >>>
          >>Sincerely,
          >>>
          >>Steven Cheng
          >>>
          >>Microsoft MSDN Online Support Lead
          >>>
          >>>
          >>Delighting our customers is our #1 priority. We welcome your comments
          >>and
          >>suggestions about how we can improve the support we provide to you.
          >>Please
          >>feel free to let my manager know what you think of the level of service
          >>provided. You can send feedback directly to my manager at:
          >>msdnmg@microsof t.com.
          >>>
          >>============= =============== =============== =======
          >>Get notification to my posts through email? Please refer to
          >>http://msdn.microsoft.com/subscripti...ult.aspx#notif
          >>ications.
          >>>
          >>============= =============== =============== =======
          >>This posting is provided "AS IS" with no warranties, and confers no
          >>rights.
          >>>
          >>--------------------
          >>>>From: "Peter" <czupet@nospam. nospam>
          >>>>Subject: Open Word Document from a Dialog Web Page
          >>>>Date: Wed, 30 Apr 2008 23:00:55 -0500
          >>>
          >>>>
          >>>>ASP.NET 2.0
          >>>>
          >>>>I am trying to open a Word document and Excel document from a dialog web
          >>>>page, what's the best way to do that?
          >>>>
          >>>>I have tried the following:
          >>>>
          >>>>Response.Cl ear();
          >>>>Response.Ad dHeader("Conten t-Disposition", "attachment ; filename=" +
          >>>>file.Name );
          >>>>Response.Ad dHeader("Conten t-Length", file.Length.ToS tring());
          >>>>Response.Co ntentType = "applicatio n/octet-stream";
          >>>>Response.Wr iteFile(file.Fu llName);
          >>>>Response.En d();
          >>>>
          >>>>
          >>>>but I am getting the following error message.
          >>>>
          >>>>Unable to evaluate expression because the code is optimized or a native
          >>>>frame is on top of the call stack.
          >>>>
          >>>>
          >>>>Thank You
          >>>>
          >>>>
          >>>>Peter
          >>>>
          >>>>
          >>>>
          >>>
          >>
          >>

          Comment

          • Fernando Rodriguez, MCP

            #6
            Re: Open Word Document from a Dialog Web Page

            Can u post the stack trace of the error?

            "Peter" <czupet@nospam. nospamwrote in message
            news:Onvw5V8qIH A.672@TK2MSFTNG P02.phx.gbl...
            Yes, but the error occurs on the Response.End();
            >
            "S.M. Altaf [MVP]" <smaltaf@mNOSPA Msn.comwrote in message
            news:AFCD26C4-B9B5-4CE3-BDE3-F674342DF778@mi crosoft.com...
            >Are you attempting to execute any code after the Response.End()?
            >>
            >--
            >---------------------------------------------------
            >S.M. Altaf [MVP]
            >http://www.mendhak.com/
            >>
            >>
            >"Peter" <czupet@nospam. nospamwrote in message
            >news:Om7IoI4qI HA.3616@TK2MSFT NGP06.phx.gbl.. .
            >>I have a dialog page and on that page is a submitt button, when a user
            >>clicks on the submit button I want to open a Word or Excel file.
            >>The Word or Excel file already exitst on the web server.
            >>>
            >>"Steven Cheng [MSFT]" <stcheng@online .microsoft.comw rote in message
            >>news:7k7oiY2q IHA.1784@TK2MSF TNGHUB02.phx.gb l...
            >>>Hi Peter,
            >>>>
            >>>Regarding on the open excel file in dialog page issue, would you
            >>>provide
            >>>some further information such as how to open the dialog page and
            >>>whether
            >>>the dialog page's url is the page that write out excel file or if the
            >>>dialog page want to open another page that write out excel file?
            >>>>
            >>>Based on my understanding, if the dialog page directy point to the
            >>>excel
            >>>page, it may cause problem due to the client-side browser's dialog
            >>>model.
            >>>Is there any particular requirement that you need to open excel file in
            >>>dialog pgae?
            >>>>
            >>>Sincerely,
            >>>>
            >>>Steven Cheng
            >>>>
            >>>Microsoft MSDN Online Support Lead
            >>>>
            >>>>
            >>>Delighting our customers is our #1 priority. We welcome your comments
            >>>and
            >>>suggestion s about how we can improve the support we provide to you.
            >>>Please
            >>>feel free to let my manager know what you think of the level of service
            >>>provided. You can send feedback directly to my manager at:
            >>>msdnmg@microsof t.com.
            >>>>
            >>>============ =============== =============== ========
            >>>Get notification to my posts through email? Please refer to
            >>>http://msdn.microsoft.com/subscripti...ult.aspx#notif
            >>>ications.
            >>>>
            >>>============ =============== =============== ========
            >>>This posting is provided "AS IS" with no warranties, and confers no
            >>>rights.
            >>>>
            >>>--------------------
            >>>>>From: "Peter" <czupet@nospam. nospam>
            >>>>>Subject: Open Word Document from a Dialog Web Page
            >>>>>Date: Wed, 30 Apr 2008 23:00:55 -0500
            >>>>
            >>>>>
            >>>>>ASP.NET 2.0
            >>>>>
            >>>>>I am trying to open a Word document and Excel document from a dialog
            >>>>>web
            >>>>>page, what's the best way to do that?
            >>>>>
            >>>>>I have tried the following:
            >>>>>
            >>>>>Response.C lear();
            >>>>>Response.A ddHeader("Conte nt-Disposition", "attachment ; filename=" +
            >>>>>file.Name) ;
            >>>>>Response.A ddHeader("Conte nt-Length", file.Length.ToS tring());
            >>>>>Response.C ontentType = "applicatio n/octet-stream";
            >>>>>Response.W riteFile(file.F ullName);
            >>>>>Response.E nd();
            >>>>>
            >>>>>
            >>>>>but I am getting the following error message.
            >>>>>
            >>>>>Unable to evaluate expression because the code is optimized or a native
            >>>>>frame is on top of the call stack.
            >>>>>
            >>>>>
            >>>>>Thank You
            >>>>>
            >>>>>
            >>>>>Peter
            >>>>>
            >>>>>
            >>>>>
            >>>>
            >>>
            >>>
            >
            >

            Comment

            • Steven Cheng [MSFT]

              #7
              Re: Open Word Document from a Dialog Web Page

              Hi Peter,

              Does the problem definite occur? Based on my test, though the modal dialog
              may not display the output word/excel document correct, it will not report
              exception at server-side(the Response.End code should get executed
              correctly). Is it also specific to a certain office document? You can try
              write out a very simple word or excel document to see whether the problem
              occurs.

              Sincerely,

              Steven Cheng

              Microsoft MSDN Online Support Lead


              Delighting our customers is our #1 priority. We welcome your comments and
              suggestions about how we can improve the support we provide to you. Please
              feel free to let my manager know what you think of the level of service
              provided. You can send feedback directly to my manager at:
              msdnmg@microsof t.com.

              =============== =============== =============== =====
              Get notification to my posts through email? Please refer to
              Gain technical skills through documentation and training, earn certifications and connect with the community

              ications.

              This posting is provided "AS IS" with no warranties, and confers no rights.

              --------------------
              >From: "Peter" <czupet@nospam. nospam>
              >References: <u8rL2$zqIHA.50 96@TK2MSFTNGP02 .phx.gbl>
              <7k7oiY2qIHA.17 84@TK2MSFTNGHUB 02.phx.gbl>
              <Om7IoI4qIHA.36 16@TK2MSFTNGP06 .phx.gbl>
              <AFCD26C4-B9B5-4CE3-BDE3-F674342DF778@mi crosoft.com>
              >Subject: Re: Open Word Document from a Dialog Web Page
              >Date: Thu, 1 May 2008 14:56:39 -0500
              >Yes, but the error occurs on the Response.End();
              >
              >"S.M. Altaf [MVP]" <smaltaf@mNOSPA Msn.comwrote in message
              >news:AFCD26C 4-B9B5-4CE3-BDE3-F674342DF778@mi crosoft.com...
              >Are you attempting to execute any code after the Response.End()?
              >>
              >--
              >---------------------------------------------------
              >S.M. Altaf [MVP]
              >http://www.mendhak.com/
              >>
              >>
              >"Peter" <czupet@nospam. nospamwrote in message
              >news:Om7IoI4qI HA.3616@TK2MSFT NGP06.phx.gbl.. .
              >>I have a dialog page and on that page is a submitt button, when a user
              >>clicks on the submit button I want to open a Word or Excel file.
              >>The Word or Excel file already exitst on the web server.
              >>>
              >>"Steven Cheng [MSFT]" <stcheng@online .microsoft.comw rote in message
              >>news:7k7oiY2q IHA.1784@TK2MSF TNGHUB02.phx.gb l...
              >>>Hi Peter,
              >>>>
              >>>Regarding on the open excel file in dialog page issue, would you
              provide
              >>>some further information such as how to open the dialog page and
              whether
              >>>the dialog page's url is the page that write out excel file or if the
              >>>dialog page want to open another page that write out excel file?
              >>>>
              >>>Based on my understanding, if the dialog page directy point to the
              excel
              >>>page, it may cause problem due to the client-side browser's dialog
              >>>model.
              >>>Is there any particular requirement that you need to open excel file in
              >>>dialog pgae?
              >>>>
              >>>Sincerely,
              >>>>
              >>>Steven Cheng
              >>>>
              >>>Microsoft MSDN Online Support Lead
              >>>>
              >>>>
              >>>Delighting our customers is our #1 priority. We welcome your comments
              >>>and
              >>>suggestion s about how we can improve the support we provide to you.
              >>>Please
              >>>feel free to let my manager know what you think of the level of service
              >>>provided. You can send feedback directly to my manager at:
              >>>msdnmg@microsof t.com.
              >>>>
              >>>============ =============== =============== ========
              >>>Get notification to my posts through email? Please refer to
              >>>>
              http://msdn.microsoft.com/subscripti...ult.aspx#notif
              >>>ications.
              >>>>
              >>>============ =============== =============== ========
              >>>This posting is provided "AS IS" with no warranties, and confers no
              >>>rights.
              >>>>
              >>>--------------------
              >>>>>From: "Peter" <czupet@nospam. nospam>
              >>>>>Subject: Open Word Document from a Dialog Web Page
              >>>>>Date: Wed, 30 Apr 2008 23:00:55 -0500
              >>>>
              >>>>>
              >>>>>ASP.NET 2.0
              >>>>>
              >>>>>I am trying to open a Word document and Excel document from a dialog
              web
              >>>>>page, what's the best way to do that?
              >>>>>
              >>>>>I have tried the following:
              >>>>>
              >>>>>Response.C lear();
              >>>>>Response.A ddHeader("Conte nt-Disposition", "attachment ; filename=" +
              >>>>>file.Name) ;
              >>>>>Response.A ddHeader("Conte nt-Length", file.Length.ToS tring());
              >>>>>Response.C ontentType = "applicatio n/octet-stream";
              >>>>>Response.W riteFile(file.F ullName);
              >>>>>Response.E nd();
              >>>>>
              >>>>>
              >>>>>but I am getting the following error message.
              >>>>>
              >>>>>Unable to evaluate expression because the code is optimized or a native
              >>>>>frame is on top of the call stack.
              >>>>>
              >>>>>
              >>>>>Thank You
              >>>>>
              >>>>>
              >>>>>Peter
              >>>>>
              >>>>>
              >>>>>
              >>>>
              >>>
              >>>
              >
              >
              >

              Comment

              • Peter

                #8
                Re: Open Word Document from a Dialog Web Page

                I've used iframe instead and it works fine.

                string officeDocScript = "<div>"
                + "<iframe width=\"75%\" height=\"55%\" name=\"fframe\" src=\"" +
                filePath + "\">"
                + "<embed src=\"" + filePath + "\">"
                + "</iframe></div>";


                "Steven Cheng [MSFT]" <stcheng@online .microsoft.comw rote in message
                news:XOOFTOArIH A.4284@TK2MSFTN GHUB02.phx.gbl. ..
                Hi Peter,
                >
                Does the problem definite occur? Based on my test, though the modal dialog
                may not display the output word/excel document correct, it will not report
                exception at server-side(the Response.End code should get executed
                correctly). Is it also specific to a certain office document? You can try
                write out a very simple word or excel document to see whether the problem
                occurs.
                >
                Sincerely,
                >
                Steven Cheng
                >
                Microsoft MSDN Online Support Lead
                >
                >
                Delighting our customers is our #1 priority. We welcome your comments and
                suggestions about how we can improve the support we provide to you. Please
                feel free to let my manager know what you think of the level of service
                provided. You can send feedback directly to my manager at:
                msdnmg@microsof t.com.
                >
                =============== =============== =============== =====
                Get notification to my posts through email? Please refer to
                Gain technical skills through documentation and training, earn certifications and connect with the community

                ications.
                >
                This posting is provided "AS IS" with no warranties, and confers no
                rights.
                >
                --------------------
                >>From: "Peter" <czupet@nospam. nospam>
                >>References: <u8rL2$zqIHA.50 96@TK2MSFTNGP02 .phx.gbl>
                <7k7oiY2qIHA.17 84@TK2MSFTNGHUB 02.phx.gbl>
                <Om7IoI4qIHA.36 16@TK2MSFTNGP06 .phx.gbl>
                <AFCD26C4-B9B5-4CE3-BDE3-F674342DF778@mi crosoft.com>
                >>Subject: Re: Open Word Document from a Dialog Web Page
                >>Date: Thu, 1 May 2008 14:56:39 -0500
                >
                >>Yes, but the error occurs on the Response.End();
                >>
                >>"S.M. Altaf [MVP]" <smaltaf@mNOSPA Msn.comwrote in message
                >>news:AFCD26 C4-B9B5-4CE3-BDE3-F674342DF778@mi crosoft.com...
                >>Are you attempting to execute any code after the Response.End()?
                >>>
                >>--
                >>---------------------------------------------------
                >>S.M. Altaf [MVP]
                >>http://www.mendhak.com/
                >>>
                >>>
                >>"Peter" <czupet@nospam. nospamwrote in message
                >>news:Om7IoI4q IHA.3616@TK2MSF TNGP06.phx.gbl. ..
                >>>I have a dialog page and on that page is a submitt button, when a user
                >>>clicks on the submit button I want to open a Word or Excel file.
                >>>The Word or Excel file already exitst on the web server.
                >>>>
                >>>"Steven Cheng [MSFT]" <stcheng@online .microsoft.comw rote in message
                >>>news:7k7oiY2 qIHA.1784@TK2MS FTNGHUB02.phx.g bl...
                >>>>Hi Peter,
                >>>>>
                >>>>Regarding on the open excel file in dialog page issue, would you
                provide
                >>>>some further information such as how to open the dialog page and
                whether
                >>>>the dialog page's url is the page that write out excel file or if the
                >>>>dialog page want to open another page that write out excel file?
                >>>>>
                >>>>Based on my understanding, if the dialog page directy point to the
                excel
                >>>>page, it may cause problem due to the client-side browser's dialog
                >>>>model.
                >>>>Is there any particular requirement that you need to open excel file
                >>>>in
                >>>>dialog pgae?
                >>>>>
                >>>>Sincerely ,
                >>>>>
                >>>>Steven Cheng
                >>>>>
                >>>>Microsoft MSDN Online Support Lead
                >>>>>
                >>>>>
                >>>>Delightin g our customers is our #1 priority. We welcome your comments
                >>>>and
                >>>>suggestio ns about how we can improve the support we provide to you.
                >>>>Please
                >>>>feel free to let my manager know what you think of the level of
                >>>>service
                >>>>provided. You can send feedback directly to my manager at:
                >>>>msdnmg@microsof t.com.
                >>>>>
                >>>>=========== =============== =============== =========
                >>>>Get notification to my posts through email? Please refer to
                >>>>>
                http://msdn.microsoft.com/subscripti...ult.aspx#notif
                >>>>ications.
                >>>>>
                >>>>=========== =============== =============== =========
                >>>>This posting is provided "AS IS" with no warranties, and confers no
                >>>>rights.
                >>>>>
                >>>>--------------------
                >>>>>>From: "Peter" <czupet@nospam. nospam>
                >>>>>>Subject : Open Word Document from a Dialog Web Page
                >>>>>>Date: Wed, 30 Apr 2008 23:00:55 -0500
                >>>>>
                >>>>>>
                >>>>>>ASP.NET 2.0
                >>>>>>
                >>>>>>I am trying to open a Word document and Excel document from a dialog
                web
                >>>>>>page, what's the best way to do that?
                >>>>>>
                >>>>>>I have tried the following:
                >>>>>>
                >>>>>>Response. Clear();
                >>>>>>Response. AddHeader("Cont ent-Disposition", "attachment ; filename=" +
                >>>>>>file.Name );
                >>>>>>Response. AddHeader("Cont ent-Length", file.Length.ToS tring());
                >>>>>>Response. ContentType = "applicatio n/octet-stream";
                >>>>>>Response. WriteFile(file. FullName);
                >>>>>>Response. End();
                >>>>>>
                >>>>>>
                >>>>>>but I am getting the following error message.
                >>>>>>
                >>>>>>Unable to evaluate expression because the code is optimized or a
                >>>>>>native
                >>>>>>frame is on top of the call stack.
                >>>>>>
                >>>>>>
                >>>>>>Thank You
                >>>>>>
                >>>>>>
                >>>>>>Peter
                >>>>>>
                >>>>>>
                >>>>>>
                >>>>>
                >>>>
                >>>>
                >>
                >>
                >>
                >

                Comment

                Working...