hello I trying to export a gridview to excel in my project, but I got this error:
"Sys.WebForms.PageRequestManagerParserErrorException:The message received from the server could not be parsed. Common causesfor this error are when the response is modified by calls toResponse.Write(), response filters, HttpModules, or server trace isenabled."
is there a way to export this without response.write or to solve this issue with ajax
I solve the problem like this:
protectedvoid Page_Init()
{
PostBackTrigger trigger =newPostBackTrigger();
trigger.ControlID = ((Button)pnGridViewProcess.FindControl("btnExcel")).UniqueID.ToString();
((System.Web.UI.UpdatePanel)Page.Controls[0].FindControl("UpdatePanel1")).Triggers.Add(trigger);
}
No comments:
Post a Comment