简体   繁体   English

长时间运行的asp.net更新面板

[英]asp.net update panel with long running process

I have a long running process. 我的过程很漫长。

Which takes backup of MySQL server database and create an rar file. 它将备份MySQL服务器数据库并创建一个rar文件。

This process takes few minutes but works fine. 此过程需要几分钟,但效果很好。

My problem is when i write my code inside update panel it doesn't update form control after process completion. 我的问题是,当我在更新面板中编写代码时,它在处理完成后不会更新表单控件。

Html HTML

<ajaxToolkit:ToolkitScriptManager runat="server" ID="ScriptManager1" EnablePageMethods="true" />
<asp:UpdatePanel ID="uPnlMain" runat="server" UpdateMode="Conditional">
    <ContentTemplate> 
         controls goes here......

         <asp:Button ID="btnSave" runat="server" CssClass="btn" OnClick="btnSave_Click" Text="Backup" />
         <asp:Button ID="btnClear" runat="server" CssClass="btn" Text="Clear" OnClick="btnClear_Click" />
    <ContentTemplate> 
</asp:UpdatePanel>

Server Side 服务器端

protected void btnSave_Click(object sender, EventArgs e)
{
   //This process takes few minutes in execution.
   code goes here...
   //call update panel update method.
   uPnlMain.Update();
}

Can any one tell me what is the problem and how can i solve this. 谁能告诉我问题是什么,我该如何解决。

Note:- Under update panel this code works fine but it doesn't update any control on form. 注意:-在“更新”面板下,此代码可以正常工作,但不会更新窗体上的任何控件。 It takes backup and create rar as well as. 它也需要备份并创建rar。

You need a script manager to update forms in asp.net. 您需要脚本管理器来更新asp.net中的表单。 Try something like this bro: http://msdn.microsoft.com/en-us/library/bb399001.aspx . 试试这样的兄弟: http : //msdn.microsoft.com/en-us/library/bb399001.aspx BTW can you post the code to back up the mysql database into a rar? 顺便说一句,您可以发布代码以将mysql数据库备份到rar中吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM