How Do You Open an Excel Spreadsheet Using MVC?

I need to open an Excel Spreadsheet using MVC with the ActionResult MVC pattern?

Thanks,

Dan
danielolorenzAsked:
Who is Participating?
 
Bob LearnedConnect With a Mentor Commented:
It sounds like you need a File action result:

public ActionResult OpenExcel(string fileName)
{
    ...
    return File(filename), "application/xls");
}

Open in new window

0
 
Alexandre SimõesManager / Technology SpecialistCommented:
Well, I'm missing some information here.

MVC is not responsible for opening any excel file so where do you need to open it and what do you want to do with it?

Do you want to open it in C# and do something with it or you just need to give the user the option to open a certain file in its own installed Excel application?
0
All Courses

From novice to tech pro — start learning today.