on page load using javascript i disable the button .
that is
protected void Page_Load(object sender, EventArgs e){
{
btnExcel.Attributes.Add("onclick", " this.disabled = true; " + ClientScript.GetPostBackEventReference(btnExcel, null) + ";");
}
now i want is to enable the button control
protected void btnExcel_Click(object sender, EventArgs e)
{
1. Rpt.ExportToHttpResponse(ExportFormatType.Excel, Response, true, "Project Summary Report");
2. btnexcel.enable=true;
}
after executing
1 statment
why control doesnot execute
2 statement in asp.net 2.0
if
2 statement not executed then my button control not enable.
if i put this statement
Rpt.ExportToHttpResponse(ExportFormatType.Excel, Response, true, "Summary Report");
in try block then in catch block get msg Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack
if comment this statement Rpt.ExportToHttpResponse(ExportFormatType.Excel, Response, true, "Summary Report");
then btnexcel.enable=true; statement executed.
so how can i solve this issue.