Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
SQL
public class FileUploadController : Controller
   {
       //
       // GET: /FileUpload/

       public ActionResult File()
       {
           return View();
       }
       [HttpGet]
       [Actionname("File")]
       public FileResult File()
       {
           return new FilePathResult("~/Files/Document.pdf", "Application.pdf");
       }


Here my intention is to create a downloadable file but when i'am build the project i'am getting the above specified error? even i mentioned with [HttpPost] and Actionname Attributes why?how to solve this? help me thanks in advance
Posted

1 solution

You defined two Action Result methods which have the same name "File()".
Rename one of them.
C#
[HttpGet, [ActionName("File")]
public FileResult FileGet()
{
   return new FilePathResult("~/Files/Document.pdf", "Application.pdf");
}
 
Share this answer
 
v2

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900