zimmer9
asked on
In ASP.NET 4.0 using C#, how would you prevent READ-ONLY status when creating an Excel 2003 file by exporting records from GridView?
I'm writing my first ASP.NET 4.0 application using C# with VS2010.
I am trying to export a stored procedure result set to an Excel 2003 file.
When I create the new Excel file, I notice that the title bar states that it is READ-ONLY.
Do you know how I can modify my following code to get rid of the READ-ONLY status on the Excel file?
My code is in the attachment:
-------------------------- --
ExcelExport.txt
I am trying to export a stored procedure result set to an Excel 2003 file.
When I create the new Excel file, I notice that the title bar states that it is READ-ONLY.
Do you know how I can modify my following code to get rid of the READ-ONLY status on the Excel file?
My code is in the attachment:
--------------------------
ExcelExport.txt
As this file is considered "downloaded" for security reasons it is marked as read only. Try adding this site to trusted sites section in your browser( still I think it might not work and make the file read only)
Try this,
var fInfo = new FileInfo(YourFilePathName );
fInfo.IsReadOnly = false;
var fInfo = new FileInfo(YourFilePathName );
fInfo.IsReadOnly = false;
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.