This article will gradually lead you to the DataGrid Web Server control item on ASP.NET Webform, and then turn the DataGrid content to Microsoft Excel. technology
This article will explain two exchanges
DataGrid information technology:
Using the Excel MIME type (or content type) You can use the servo-end program code to link the DataGrid to the information, then open the information in the Excel of the client computer. If you want to perform this, set contentType to Application / VND.ms-Excel. After the user receives the new information flow, the information will be displayed in Excel, just open content in a web browser's new web page. Using Excel Automation You can use the user's program code, capture from the DataGrid into html, then "Automatically perform Excel" to display HTML with a new homebook. "Excel Automation" will always display data outside the browser of the Excel application window. "Automation" is the advantage that if you want to modify the loafa in the remapping, you can control Excel. However, since Excel's instruction code is not secure, the client must be set to "Automation" security settings on the web browser.
Step by step
Start Visual Studio .NET. In the [File] menu, point to [Add], then press [Explan]. Press [Visual Basic Project] in the [Project Type] pane. Press [ASP.NET Web Application] under [Model]. Name your application Excelexport, then click [OK]. WebForm1 will appear in "Design" inspection. Press the right mouse button on the [WebForm1.aspx] of the "Solution General", then press [Rename]. Change the file name to Bottom.aspx. In the [View] function table, press [HTML Original], add the following DataGrid to the