Click here to Skip to main content
15,922,894 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
on page load using javascript i disable the button .

that is
C#
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
C#
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
C#
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.
Posted
Updated 2-May-12 23:14pm
v3

1 solution

Repost. See my answer to the newest version of this question. The Response() object is getting overwritten.
 
Share this answer
 
Comments
Member 8861818 3-May-12 5:16am    
i don,t understand the solution u have given

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900