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

Below is my code:

        If File.Exists(filename) Then
            lit1.Text = "<IFRAME NAME='embeddedFrame' WIDTH='90%' HEIGHT='90%' SRC='TTT.pdf'/>"
            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.
Who is Participating?
CodeCruiserConnect With a Mentor Commented:
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.
Obadiah ChristopherConnect With a Mentor Commented:
WIll the path be constant? i.e c:temp
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.

NettodotnetAuthor Commented:
Yes it is constant
Monica PConnect With a Mentor Software DeveloperCommented:
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



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

NettodotnetAuthor Commented:
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?
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.