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 NairPosted Sep 13, 2013, 7:50 AM
GANESH BELAGALIPosted Sep 28, 2013, 3:30 AM
Rajesh SPosted Sep 12, 2013, 1:01 PM
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 BELAGALIPosted Sep 12, 2013, 5:32 AM
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 SPosted Jun 1, 2011, 6:42 AM
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.
Suthish NairPosted Jun 1, 2011, 5:32 AM
Dorababu MekaPosted Jun 1, 2011, 5:30 AM
http://pohee.com/general/sys-webforms-pagerequestmanagerparsererrorexception-in-ms-ajax/
Rajesh SPosted Jun 1, 2011, 5:21 AM
Dorababu MekaPosted Jun 1, 2011, 5:17 AM
Dorababu MekaPosted Jun 1, 2011, 5:16 AM
Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerParserErrorException:
Rajesh SPosted Jun 1, 2011, 5:13 AM
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 MekaPosted Jun 1, 2011, 4:55 AM
Rajesh SPosted Jun 1, 2011, 4:54 AM
Dorababu MekaPosted Jun 1, 2011, 4:51 AM
Rajesh SPosted Jun 1, 2011, 4:49 AM
here i have attached my code...
Dorababu MekaPosted Jun 1, 2011, 4:22 AM
<Triggers>
<asp:PostBackTrigger ControlID="lbtnDownload"/>
Triggers>
Suthish NairPosted Jun 1, 2011, 3:53 AM
Dorababu MekaPosted Jun 1, 2011, 3:50 AM
Rajesh SPosted Jun 1, 2011, 2:45 AM
Any one can help me soon...actually i am spending long time for this thats what i am getting hurry.
Rajesh SPosted Jun 1, 2011, 12:56 AM
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
Suthish NairPosted May 31, 2011, 1:57 PM
Dorababu MekaPosted May 31, 2011, 12:05 PM
http://weblogs.asp.net/leftslipper/archive/2007/02/26/sys-webforms-pagerequestmanagerparsererrorexception-what-it-is-and-how-to-avoid-it.aspx
Dorababu MekaPosted May 31, 2011, 12:03 PM
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.
Rajesh SPosted May 31, 2011, 12:01 PM
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.
Rajesh SPosted May 31, 2011, 11:58 AM
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";
Dorababu MekaPosted May 31, 2011, 11:39 AM
Please Wait...
Posted May 31, 2011, 11:37 AM
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 MekaPosted May 31, 2011, 11:34 AM
Posted May 31, 2011, 11:24 AM