TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Kunal Bhajbhuje
NA
16
439
How to use Linkbutton control to download the document ?
Mar 11 2019 2:17 AM
My code so far...
protected
void
LinkButton3_Click(
object
sender, EventArgs e)
{
string
filename = “~/Users/Kunal/Desktop/Website EasyGo Email/EasyMon Specifications_Rev1.1.pdf”;
if
(filename != “”)
{
string
path = Server.MapPath(filename);
System.IO.FileInfo file =
new
System.IO.FileInfo(path);
if
(file.Exists)
{
Response.Clear();
Response.AddHeader(“Content-Disposition”, “attachment; filename=” +filename);
Response.AddHeader(“Content-Length”, file.Length.ToString());
Response.ContentType = “EasyMon Specifications_Rev1.1.pdf”;
Response.WriteFile(file.FullName);
Response.End();
}
else
{
Response.Write(“This file does not exist.”);
}
}
}
Reply
Answers (
2
)
pie chart is not visible
Mapping Library