Click here to Skip to main content
11,438,226 members (56,967 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 2:11am
Abhi KA1.9K
Edited 20-Jan-13 20: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)



Advertise | Privacy | Mobile
Web01 | 2.8.150506.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