1. get the contents of grid
document.getElementById("DG1").outerHTML;
2. submit the form to a new page or same page
3. then set the content type like below
Response.ContentType="application/vnd.ms-excel";
Response.Charset = "";
this.EnableViewState=false;