PrepAway - Latest Free Exam Questions & Answers

You need to enable users to open Excel files.How should…

HOTSPOT
You are developing an ASP.NET MVC web application that enables users to open Microsoft Excel files.
The current implementation of the ExcelResult class is as follows.

You need to enable users to open Excel files.How should you implement the ExecuteResult method? (To answer, select the appropriate options in the
answer area.)
Hot Area:

PrepAway - Latest Free Exam Questions & Answers

Answer:

Explanation:
Target 1:
Name: AcceptTypes
Synopsis: stringArray = Request.AcceptTypes
Returns a String array containing theMultipurpose Internet Mail Extension (MIME) types accepted by the client.
You can use this property to determine whether a client can accept certain response types, including
application types such as Word or Excel, which are supported only by Internet Explorer.
Target 2, Target 3:
Example: Response.AddHeader(“content-disposition”, “attachment; filename=MyExcelFile.xls”);
Response.ContentType = “application/ms-excel”;
Export data to Excel file with ASP.NET MVC 4 C# is rendering into view
http://stackoverflow.com/questions/16346227/export-data-to-excel-file-with-asp-net-mvc-4-c-sharp-is-renderinginto-view


Leave a Reply