System.Threading.Thread.Sleep(3000); System.IO.StringWriter sw = new System.IO.StringWriter(); HtmlTextWriter htw = new HtmlTextWriter(sw); gvEmpdetails.AllowPaging = false; BindGrid(); //Applying stlye to gridview header cells for (int i = 0; i < gvEmpdetails.HeaderRow.Cells.Count; i++) gvEmpdetails.HeaderRow.Cells[i].Style.Add("background-color", "#df5015"); gvEmpdetails.RenderControl(htw); Session["ResponseData"] = sw.ToString(); iframe1.Attributes.Add("src", "Download.aspx"); When user the Open button in the popup excel is open it is working correctly. Simliarily When user Click Save button in the popup the user select the path where excel is to be there and save the excel file. for that saving the excel file what code i have to do. What I have tried: i have gridview and i am exproting that gridview data to excel. Before downloading i show popup as Open Save Cancel. When user click the Open the excel is file open. The excel open code as follows <pre lang="C#">System.Threading.Thread.Sleep(3000); System.IO.StringWriter sw = new System.IO.StringWriter(); HtmlTextWriter htw = new HtmlTextWriter(sw); gvEmpdetails.AllowPaging = false; BindGrid(); //Applying stlye to gridview header cells for (int i = 0; i < gvEmpdetails.HeaderRow.Cells.Count; i++) gvEmpdetails.HeaderRow.Cells[i].Style.Add("background-color", "#df5015"); gvEmpdetails.RenderControl(htw); Session["ResponseData"] = sw.ToString(); iframe1.Attributes.Add("src", "Download.aspx"); When user the Open button in the popup excel is open it is working correctly. Simliarily When user Click Save button in the popup the user select the path where excel is to be there and save the excel file. for that saving the excel file what code i have to do.
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)