ybt
asked on
PDF document on a web page
In ASP.NET C# I create a possibility to open pdf file
in cs file:
protected void bttnpdf_Click(object sender, EventArgs e)
{
WebClient User = new WebClient();
Byte[] FileBuffer = User.DownloadData("\\\\lsm fs1\\72698 4\\2016\\7 26984.pdf" );
if (FileBuffer != null)
{
Response.ContentType = "application/pdf";
Response.AddHeader("conten t-length", FileBuffer.Length.ToString ());
Response.BinaryWrite(FileB uffer);
}
}
in aspx:
<asp:Button ID="bttnpdf" runat="server" Text="Click for open PDF" Font-Bold="True" OnClick="bttnpdf_Click" />
PDF document takes whole page to open, I do not find an option to go back, only close browser,
can I open this document in some container in the page or create some "BACK" functionality?
in cs file:
protected void bttnpdf_Click(object sender, EventArgs e)
{
WebClient User = new WebClient();
Byte[] FileBuffer = User.DownloadData("\\\\lsm
if (FileBuffer != null)
{
Response.ContentType = "application/pdf";
Response.AddHeader("conten
Response.BinaryWrite(FileB
}
}
in aspx:
<asp:Button ID="bttnpdf" runat="server" Text="Click for open PDF" Font-Bold="True" OnClick="bttnpdf_Click" />
PDF document takes whole page to open, I do not find an option to go back, only close browser,
can I open this document in some container in the page or create some "BACK" functionality?
Can you open it in an IFrame? I do this all the time. The page containing the IFrame can have a back button. Use javascript to go back 1 page in history.
i pass the id of the pdf document to an ashx handler via a link button., tht way you can tell the the link to open in new tab.
dont have access to my code at the moment but the ashx is very similar to your current code. ( i pass an id#, where you could pass the path to file, while it is oart of url, the ashx displays the file so the path is not visible)
dont have access to my code at the moment but the ashx is very similar to your current code. ( i pass an id#, where you could pass the path to file, while it is oart of url, the ashx displays the file so the path is not visible)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you