首页 新闻 会员 周边 捐助

进度条不动,提示错误

0
悬赏园豆:40 [已关闭问题]

protected void Button_Wait(object sender, AjaxEventArgs e)
{
    Ext.Msg.Show(new MessageBox.Config
    {
        Title = "请等待",
        Message = "系统正在加载,请等待Coolite Toolkit学习笔记二:服务器端Alert,Confirm,PromptCoolite Toolkit学习笔记二:服务器端Alert,Confirm,Prompt",
        ProgressText = "系统加载中",
        Width = 300,
        Progress = true,
        Closable = false,
        AnimEl = this.btnWait.ClientID
    });
    this.StartLongAction();
}
private void StartLongAction()
{
    this.Session["Task1"] = 0;
    ThreadPool.QueueUserWorkItem(LongAction);

    this.TaskManager1.StartTask("Task1");
}
private void LongAction(object state)
{
    for (int i = 0; i < 10; i++)
    {
        Thread.Sleep(1000);
        this.Session["Task1"] = i + 1;
    }
    this.Session.Remove("Task1");
}
protected void RefreshProgress(object sender, AjaxEventArgs e)
{
    object progress = this.Session["Task1"];
    if (progress != null)
    {
        Ext.MessageBox.UpdateProgress(((int)progress) / 10f, "");
    }
    else
    {
        this.TaskManager1.StopTask("Task1");
        Ext.MessageBox.Hide();
        this.ScriptManager1.AddScript("ProgressResult();");
    }
}

 

<ext:Button ID="btnWait" runat="server" Text="Wait">
    <AjaxEvents>
        <Click OnEvent="Button_Wait"></Click>
    </AjaxEvents>
</ext:Button>
<ext:TaskManager ID="TaskManager1" runat="server">
<Tasks>
    <ext:Task
        TaskID="Task1"
        Interval="1000"
        AutoRun="false">
        <AjaxEvents>
            <Update OnEvent="RefreshProgress" />
        </AjaxEvents>                   
    </ext:Task>
</Tasks>
</ext:TaskManager>
<script type="text/javascript">
function ProgressResult() {
    alert("进度条走完了");
}
</script>

 

报错信息:TaskManager1.startTask("taskProbar")对象不支持此属性或方法

问题补充: TaskManager1.startTask("taskProbar")改成 TaskManager1.startTask("Task1")
kuangguangxiang的主页 kuangguangxiang | 初学一级 | 园豆:36
提问于:2010-06-29 11:45
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册