"Export the data in the gridview displayed on the page to an Excel table" encountered the following error: C # The format of the Excel file to be exported is different from the format specified by the extension. Details
Solution: Here we use "modify registry method" to solve this problem, which does not solve the problem from the root:
1. Open Registry Editor: Start-> Run-> enter Regedit-> OK
2. Find the Registry subitem HKEY_CURRENT_USER \ Software \ Microsoft \ Office \ 12.0 \ Excel \ Security
3. Right-click the blank area on the right, select "new-> DWORD Value (d)", enter "extensionhardening", and click "OK.
4. Right-click extensionhardening, click "Modify (m)", and enter "0" in the value data to confirm.
5. Close the Registry Editor and open the xls file again to see if the prompt is missing?
Data settings of extensionhardening values:
* 0: do not check the file extension and file type and bypass the warning message of this function.
* 1: Check the file extension and file type. If they do not match, a warning message is displayed.
* 2: Check the file extension and file type. Do not open the file if they do not match