Solved

iframe .net : How to pass Src="FileName"

Posted on 2013-01-24
6
1,344 Views
Last Modified: 2013-02-13
Below is my code:

        If File.Exists(filename) Then
            lit1.Text = "<IFRAME NAME='embeddedFrame' WIDTH='90%' HEIGHT='90%' SRC='TTT.pdf'/>"
        Else
            lit1.Text = "file to load PDF file for printing please contact Admin"
        End If


This working fine.
but how do i pass SCR="Path+FileName" which is under my "C:\Temp:TTT.PDF".


Looking for Help.
0
Comment
Question by:Nettodotnet
6 Comments
 
LVL 22

Assisted Solution

by:Mrunal
Mrunal earned 100 total points
ID: 38815513
0
 
LVL 20

Assisted Solution

by:informaniac
informaniac earned 100 total points
ID: 38815597
WIll the path be constant? i.e c:temp
0
 

Author Comment

by:Nettodotnet
ID: 38815986
Yes it is constant
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 10

Assisted Solution

by:Monica P
Monica P earned 100 total points
ID: 38817637
in asp page,

<iframe width=500 height=500 runat="server" id="myPDF" src="pdf_003.pdf"></iframe>

Open in new window


in page_load

dim filepath=Path+FileName

myPDF.Attributes.Add("src", filepath);

Open in new window


this will help u easily

http://forums.asp.net/t/1422962.aspx/1

http://stackoverflow.com/questions/11603277/display-pdf-in-iframe

Make below settings (if not shown in browser) to show the pdf file on browser ..

http://stackoverflow.com/questions/10794227/how-to-load-the-pdf-file-inside-iframe-in-asp-net
0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 200 total points
ID: 38818281
The path has to be a virtual path(under you web directory) which can be accessed from a client browser. C:\Temp would not be accessible from a client browser unless it is configured with a virtual path.
0
 

Author Comment

by:Nettodotnet
ID: 38821066
with my c# program iam creating pdf file under earc user "C:\TEMP\abc.pdf" file.
in the program itself iam trying to load that pdf in to iframe.

Is some thing not woking in vb.net?
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
jQuery on Submit 4 45
Running a javascript project in WebStorm 2 29
Change to file doesn't show up 16 56
Upgrade code from VS 2010 to VS 2015 7 18
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question