Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. pdf in iframe

pdf in iframe

Scheduled Pinned Locked Moved ASP.NET
htmlhelp
8 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    saud_a_k
    wrote on last edited by
    #1

    I can view a pdf document in html like: but when I put the same come to be dynamically written on a literal control on a button click like: protected void Button1_Click(object sender, EventArgs e) { litShow.Text = ""; } the pdf file is not displayed plz help

    _____________________________________________________ Yea! I could be wrong...

    C L 2 Replies Last reply
    0
    • S saud_a_k

      I can view a pdf document in html like: but when I put the same come to be dynamically written on a literal control on a button click like: protected void Button1_Click(object sender, EventArgs e) { litShow.Text = ""; } the pdf file is not displayed plz help

      _____________________________________________________ Yea! I could be wrong...

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      Did you check to see what IS rendered ?

      Christian Graus Driven to the arms of OSX by Vista.

      S 1 Reply Last reply
      0
      • C Christian Graus

        Did you check to see what IS rendered ?

        Christian Graus Driven to the arms of OSX by Vista.

        S Offline
        S Offline
        saud_a_k
        wrote on last edited by
        #3

        yes I do get the html code on 'view source' but the file is not displayed I tried with many files... Same result :( here is the html source

        _____________________________________________________ Yea! I could be wrong...

        modified on Sunday, January 18, 2009 8:32 AM

        C 1 Reply Last reply
        0
        • S saud_a_k

          I can view a pdf document in html like: but when I put the same come to be dynamically written on a literal control on a button click like: protected void Button1_Click(object sender, EventArgs e) { litShow.Text = ""; } the pdf file is not displayed plz help

          _____________________________________________________ Yea! I could be wrong...

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          saud_a_k wrote:

          src="C:\\file.pdf"

          You cannot quote a path like above. You should use path like http://<website>/folder/a.pdf If you still want to use the directory path then it should be like

          src="file:///C|/file.pdf"

          S 1 Reply Last reply
          0
          • S saud_a_k

            yes I do get the html code on 'view source' but the file is not displayed I tried with many files... Same result :( here is the html source

            _____________________________________________________ Yea! I could be wrong...

            modified on Sunday, January 18, 2009 8:32 AM

            C Offline
            C Offline
            Christian Graus
            wrote on last edited by
            #5

            Oh, I see.

            saud_a_k wrote:

            C:\310001.pdf

            This will only work if your server and client are the same machine, in other words, it will never work in the real world.

            Christian Graus Driven to the arms of OSX by Vista.

            1 Reply Last reply
            0
            • L Lost User

              saud_a_k wrote:

              src="C:\\file.pdf"

              You cannot quote a path like above. You should use path like http://<website>/folder/a.pdf If you still want to use the directory path then it should be like

              src="file:///C|/file.pdf"

              S Offline
              S Offline
              saud_a_k
              wrote on last edited by
              #6

              The server and client are the same machine I also used: string myfile = AppDomain.CurrentDomain.BaseDirectory+"\\310001.pdf"; litShow.Text = ""; the file is in my bin folder, but I still cant see the file :(

              _____________________________________________________ Yea! I could be wrong...

              L 1 Reply Last reply
              0
              • S saud_a_k

                The server and client are the same machine I also used: string myfile = AppDomain.CurrentDomain.BaseDirectory+"\\310001.pdf"; litShow.Text = ""; the file is in my bin folder, but I still cant see the file :(

                _____________________________________________________ Yea! I could be wrong...

                L Offline
                L Offline
                Lost User
                wrote on last edited by
                #7

                saud_a_k wrote:

                string myfile = AppDomain.CurrentDomain.BaseDirectory+"\\310001.pdf";

                This will return path as C:\<folder name(s)>\

                saud_a_k wrote:

                the file is in my bin folder, but I still cant see the file

                You need to write is as: AppDomain.CurrentDomain.BaseDirectory + "Bin\\310001.pdf"

                S 1 Reply Last reply
                0
                • L Lost User

                  saud_a_k wrote:

                  string myfile = AppDomain.CurrentDomain.BaseDirectory+"\\310001.pdf";

                  This will return path as C:\<folder name(s)>\

                  saud_a_k wrote:

                  the file is in my bin folder, but I still cant see the file

                  You need to write is as: AppDomain.CurrentDomain.BaseDirectory + "Bin\\310001.pdf"

                  S Offline
                  S Offline
                  saud_a_k
                  wrote on last edited by
                  #8

                  Thanx but it still does NOT show. I even tried making a html file with the iframe code and tried opening it in the main inframe it still does not show! Please try this.... I think its wierd create a simple html file that displays a pdf file in an iframe include the file as a part of the project on VS (i use 2005) now right click in the solution explorer and >> view in browser does it show? it doesn't for me.

                  _____________________________________________________ Yea! I could be wrong...

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups