Read this code..
<asp:UpdatePanel ID="UPDownload" runat="server">
<ContentTemplate>
<asp:Label ID="lblMessage" CssClass="LabelDefault" runat="server" Text="Click the link to download the Report:">
asp:Label>
<asp:LinkButton ID="lbtnDownload" runat="server" OnClick="lbtnDownload_Click" Text="Download Excel Sheet">asp:LinkButton>
ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="lbtnDownload"/>
Triggers>
asp:UpdatePanel>
In linkbutton click event i am generation excelsheet using Response.write..its working fine..but now i need to show the progress bar so that i used the following code
<ProgressTemplate>
<asp:Image ID="Image1" runat="server" ImageUrl="~/image/ajax-loader.gif" />
ProgressTemplate>
asp:UpdateProgress>
but its not showing the progress bar...
...any one help me to show the progress bar....thanks in advance.

Suthish NairRank #92 · 22.8K reputationPosted Sep 13, 2013, 3:50 AM EDT
Posted May 31, 2011, 7:24 AM EDT
Dorababu MekaRank #457 · 5.5K reputationPosted May 31, 2011, 7:34 AM EDT
Posted May 31, 2011, 7:37 AM EDT
Remove:
<asp:PostBackTrigger ControlID="lbtnDownload"/>
Add:
<asp:AsyncPostBackTrigger ControlID="lbtnDownload" EventName="Click" />
Please find the attached sample for your testing....
Hope this helps you.
Dorababu MekaRank #457 · 5.5K reputationPosted May 31, 2011, 7:39 AM EDT
Please Wait...
Rajesh S108 reputationPosted May 31, 2011, 7:58 AM EDT
thanks for your immediate reply.
i have tried AsyncPostBackTrigger but its shows error like
'sys.webforms.pagerequestmanagerparsererrorexception' - i knew why its showing this error because i used Response.Write in my click event of link button....
i have looked your attachements can you try this code in click event of link button at code behind so that you may understand my problem exactly.
Response.write("you write somthing you want");
instead of
System.Threading.Thread.Sleep(3000);
lblMessage.Text = "Success";
Rajesh S108 reputationPosted May 31, 2011, 8:01 AM EDT
thanks for your instant reply
I am using Response.write in click event of link button.. so that its not working when i use without PostBackTrigger...any one can advise me where i am going wrong.
Dorababu MekaRank #457 · 5.5K reputationPosted May 31, 2011, 8:03 AM EDT
Hi
It is not a good practice to use Response.Write from within an ASP.NET page in general. As UpdatePanels work by intercepting the page rendering process you are recieving the errors.
You can put the code to generate the data in an HTTPHandler or you can make the button a PostBackTrigger.
Dorababu MekaRank #457 · 5.5K reputationPosted May 31, 2011, 8:05 AM EDT
http://weblogs.asp.net/leftslipper/archive/2007/02/26/sys-webforms-pagerequestmanagerparsererrorexception-what-it-is-and-how-to-avoid-it.aspx
Suthish NairRank #92 · 22.8K reputationPosted May 31, 2011, 9:57 AM EDT
Rajesh S108 reputationPosted May 31, 2011, 8:56 PM EDT
Thank you for your response.
i have been generating the excel sheet dynamically. my code is below for generating excel sheet.
Response.ContentType= "application/vnd.ms-excel";
Response.AddHeader("Content-Disposition", "attachment; filename=abc.xls";
this.EnableViewState = false;
string a1 = "\n\n\n
string a2 = "\n\n";
Response.Write(a1 + HeaderTable + strbuilddata.ToString() + a2);
Response.End();
here 'HeaderTable' and 'strbuilddata' are stringbuilders and i have html table in stringbuilder which also generated in link button click event. so here what i need to change kindly let me know....
and one more thing i tried with Asynpostback its not working if i remove the above part of the code its working fine..
kindly advise me.....thanks in advance
Rajesh S108 reputationPosted May 31, 2011, 10:45 PM EDT
Any one can help me soon...actually i am spending long time for this thats what i am getting hurry.
Dorababu MekaRank #457 · 5.5K reputationPosted May 31, 2011, 11:50 PM EDT
Suthish NairRank #92 · 22.8K reputationPosted May 31, 2011, 11:53 PM EDT
Dorababu MekaRank #457 · 5.5K reputationPosted Jun 1, 2011, 12:22 AM EDT
<Triggers>
<asp:PostBackTrigger ControlID="lbtnDownload"/>
Triggers>
Rajesh S108 reputationPosted Jun 1, 2011, 12:49 AM EDT
here i have attached my code...
Dorababu MekaRank #457 · 5.5K reputationPosted Jun 1, 2011, 12:51 AM EDT
Rajesh S108 reputationPosted Jun 1, 2011, 12:54 AM EDT
Dorababu MekaRank #457 · 5.5K reputationPosted Jun 1, 2011, 12:55 AM EDT
Rajesh S108 reputationPosted Jun 1, 2011, 1:13 AM EDT
when i use postbacktrigger i couldnt get progressbar image...when i use Asynpostbacktrigger i am getting the error like
''sys.webforms.pagerequestmanagerparsererrorexception".......so what i need to do now..thanks in advance.
Dorababu MekaRank #457 · 5.5K reputationPosted Jun 1, 2011, 1:16 AM EDT
Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerParserErrorException:
Dorababu MekaRank #457 · 5.5K reputationPosted Jun 1, 2011, 1:17 AM EDT
Rajesh S108 reputationPosted Jun 1, 2011, 1:21 AM EDT
Dorababu MekaRank #457 · 5.5K reputationPosted Jun 1, 2011, 1:30 AM EDT
http://pohee.com/general/sys-webforms-pagerequestmanagerparsererrorexception-in-ms-ajax/
Suthish NairRank #92 · 22.8K reputationPosted Jun 1, 2011, 1:32 AM EDT
Rajesh S108 reputationPosted Jun 1, 2011, 2:42 AM EDT
yes i have read your replies.
i couldnt use excel object because it creates the single instance for all the objects in web server and if i remove the update panel, how can i archieve this..is there any other way.....kindly let me know where i am going wrong.
suthish one more thing kindly take a look into code so that you can easily identify where i did mistake.
hi Dorababu --thanks for your response
i have read the link yeaterday itself which is given by you. i could understant that but really i dont know how to solve this.....thanks in advance.
GANESH BELAGALI34 reputationPosted Sep 12, 2013, 1:32 AM EDT
I'm facing the same problem in update panel.
If i use AsyncPostBackTrigger , I'm getting below error
2. If i use PostBackTrigger ..I'm not getting progress bar...
If You got the answer please reply. Thanks in advance.
Rajesh S108 reputationPosted Sep 12, 2013, 9:01 AM EDT
I removed the Ajax update panel and I had an other way to show progress bar.
please put this div in your aspx page
<asp:LinkButton ID="lbtnDownload" runat="server" OnClientClick="javascript:divprogress();" OnClick="lbtnDownload_Click" Text="Download Excel Sheet">asp:LinkButton>
JavaScript:
Please call the below function in download button
function divprogress()
{
document.getElementbyId('FullPageDiv').visibility="visible";
}
Add the below code in CSS
#AlertDiv1
{
left: 44%; top: 1%;position: fixed;padding: 3px;border: #000000 1px solid; background-color: #FF0000;text-align: center;font-family: verdana;font-size: small;color: #FFFFFF;width: 20%;font-weight: 500;
}
#FullPageDiv
{
left: 0%;top: 0%;position: fixed;padding: 12px;border: #000000 1px solid;background-color: Gray;text-align: center;font-family: verdana;font-size: small;color: #FF0000;width: 100%;filter: alpha(opacity=80);opacity: 0.60;font-weight: bold;height: 100%;
}
#FullPage
{
left: 0%;top: 0%;position: fixed;padding: 12px;border: #000000 1px solid;background-color: Gray;text-align: center;font-family: verdana;font-size: small;color: #FF0000;width: 100%;filter: alpha(opacity=80);opacity: 0.60;font-weight: bold;height: 100%;visibility:hidden;
}
#visibleFullPage
{
left: 0%;top: 0%;position: fixed;padding: 12px;border: #000000 1px solid;background-color: Gray;text-align: center;font-family: verdana;font-size: small;color: #FF0000;width: 100%;filter: alpha(opacity=60);opacity: 0.60;font-weight: bold;height: 100%;visibility:visible;
}
So when we click on link button to download this progress bar comes to visible and it will be automatically go to invisible after completed the postback.
please let me know of any questions.
GANESH BELAGALI34 reputationPosted Sep 27, 2013, 11:30 PM EDT