i have a .aspx page in which there is a usercontrol which is populated with the data when i select the options
i was exporting the control but iam not able to get the data in the usercontrol instead of the data the entire page is exported along with banner
but if i use the same code to export datagrid or gridview its working fine
why this is not happening with usercontrol
the below code is used to export
protected void btnExport_Click(object sender, EventArgs e)
{
Response.Clear();
Response.Buffer = true;
//Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
Response.ContentType = "application/vnd.ms-excel";
Response.Charset = "";
//this.ClearControls(lbl);
this.EnableViewState = false;
StringWriter oStringWriter = new StringWriter();
HtmlTextWriter oHtmlTextWriter = new HtmlTextWriter(oStringWriter);
dg.RenderControl(oHtmlTextWriter);
Response.Write(oStringWriter.ToString());
}
Please if there is any solution try to help
its urgent