How Do You Open an Excel Spreadsheet Using MVC?

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


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

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?
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.