Click here to Skip to main content
11,702,130 members (64,602 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: MVC2
Download A excel from Local Path in MVC2
when Clicking on link Text it will open .
can you please suggest any link..
i try like below but not working


string Path = @"~\Content\templates\SAT Door Width 062012.xls";
            string contentType = "application/ms-excel";
            HttpContext.Response.Buffer = true;
            HttpContext.Response.Clear();
           HttpContext.Response.AddHeader("content-disposition",                         "attachment; filename=" + fileName);
            HttpContext.Response.ContentType = contentType;
            HttpContext.Response.WriteFile(HttpContext.Server.MapPath(Path));
Posted 18-Jan-13 1:11am
Abhi KA1.9K
Edited 20-Jan-13 19:24pm
v3
Comments
richcb at 18-Jan-13 11:24am
   
This is not a question.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Maciej Los 395
1 Sergey Alexandrovich Kryukov 355
2 OriginalGriff 339
3 CHill60 145
4 Mika Wendelius 119
0 OriginalGriff 8,344
1 Sergey Alexandrovich Kryukov 7,507
2 CPallini 4,922
3 Maciej Los 4,371
4 Mika Wendelius 3,556


Advertise | Privacy | Mobile
Web02 | 2.8.150819.1 | Last Updated 21 Jan 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100