Here Mudassar Khan has explained with an example, how to export (Grid) GridView to HTML File (HTML String) in ASP.Net MVC Razor.
First, the Grid (GridView) will be populated from database using Entity Framework and then the generated HTML Table of Grid (GridView) will be sent as HTML string to the Controller which will be exported to HTML (.htm) file in ASP.Net MVC Razor.