C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




how to open pdf file from folder on button click in asp.net


Posted Date: 30 Aug 2008      Total Responses: 1

Posted By: Ravindra Singh       Member Level: Gold     Points: 1


Dear all,
how to open pdf file from folder on button click in asp.net on another browser.




Responses

Author: sudha    01 Sep 2008Member Level: SilverRating:     Points: 6
string path = Server.MapPath(strAppPath);
System.IO.FileInfo file = new System.IO.FileInfo(path);
if (file.Exists)
{
Response.Clear();
Response.AddHeader("Content-Disposition", "attachment; filename=" + file.Name);
Response.AddHeader("Content-Length", file.Length.ToString());
Response.ContentType="application/pdf";
Response.WriteFile(file.FullName);
Response.End();
}

use this code in button event handler....



Post Reply
You must Sign In to post a response.
Next : Free Download .NET ebooks
Previous : Problem in getting print out from a aspx page?
Return to Discussion Forum
Post New Message
Category: ASP.NET

Related Messages



dotNet Slackers   BizTalk Adaptors    Web Design

web conferencing

Contact Us    Privacy Policy    Terms Of Use