2 Replies - 16461 Views - Last Post: 24 September 2008 - 07:13 AM Rate Topic: -----

#1 kumanan.c  Icon User is offline

  • New D.I.C Head

Reputation: -2
  • View blog
  • Posts: 2
  • Joined: 10-July 08

ppt inside asp.net

Posted 22 September 2008 - 10:52 PM

i need to design a webpage using (asp.net with c#) to import a ppt file. if u know that solution then pls send me immediately.

This post has been edited by kumanan.c: 22 September 2008 - 10:53 PM

Is This A Good Question/Topic? 0
  • +

Replies To: ppt inside asp.net

#2 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1632
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: ppt inside asp.net

Posted 22 September 2008 - 11:07 PM

[rules][/rules]
Was This Post Helpful? 0
  • +
  • -

#3 Sonic88  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 166
  • Joined: 19-February 08

Re: ppt inside asp.net

Posted 24 September 2008 - 07:13 AM

I have actaully been working on something like this for a while. You have to set your headers of a dummy page and then set that as the src of IFRame in your parent page. I can not for the life of me get the thing to open inside the page. It always wants to open powerpoint, or excel (depending on file type) and open the file inside the app. My boss insists on it opening in the page.


        'test for session data to prevent exception when app hits this twice
        If Not Session("fileName") Is Nothing And Not Session("mimeType") Is Nothing Then
            'get the filename and mimetype from session
            Dim fileName As String = Session("fileName").ToString
            Dim mimeType As String = Session("mimeType").ToString

            Dim path As String = Server.MapPath(Common.materialPath)
            Dim file As System.IO.FileInfo = New System.IO.FileInfo(path + fileName)

            If file.Exists Then
                'if file exists, set the header info
                Response.Clear()
                Response.ContentType = mimeType

                Response.AddHeader("Content-Disposition", "inline; filename=" & file.Name)
                Response.AddHeader("Content-Length", file.Length.ToString())

                Response.WriteFile(file.FullName)
                Response.End()
            End If
        End If



It is my understanding that the "inline" in this line:
Response.AddHeader("Content-Disposition", "inline; filename=" & file.Name)
is to make it open in the page. Psycho do you have any ideas on this?
Was This Post Helpful? 1

Page 1 of 1