简体   繁体   English

在Ajax UpdateProgress中显示Jquery EasyUI Function

[英]Show Jquery EasyUI Function inside Ajax UpdateProgress

Morning! 早上!

I have a asp.net UpdatePanel with an UpdateProgress inside calling a UserControl that fires an animation during the page postback. 我有一个带有UpdateProgress的asp.net UpdatePanel,它调用一个在页面回发期间触发动画的UserControl。 On this situation, works perfectly, but i'm trying to make a little change on this animation, placing an Easyui progress popup on place. 在这种情况下,可以完美运行,但是我正在尝试对此动画进行一些更改,以放置Easyui进度弹出窗口。

Here's URL to EasyUI progress popup demo: http://www.jeasyui.com/demo/main/index.php?plugin=Messager&theme=default&dir=ltr&pitem=# 以下是EasyUI进度弹出演示的URL: http : //www.jeasyui.com/demo/main/index.php? plugin=Messager&theme=default&dir=ltr&pitem =#

Here's my ASPX code: 这是我的ASPX代码:

<asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1">
    <ProgressTemplate>
        <uc1:Loading runat="server" ID="Loading" />
    </ProgressTemplate>
</asp:UpdateProgress>

and UserControl Page: 和UserControl页面:

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Loading.ascx.cs" Inherits="Test.UserControl.Loading" %>

<link href="css/loading.css" rel="stylesheet" type="text/css" />

<div class="LoadingContainerBackground">
<div class="LoadingGreyBackground">
</div>
<div class="LoadingTableHolder">
    <table style="text-align: center; width: 100%; border-spacing: 0; border-collapse: collapse;">
        <tr>
            <td colspan="3" style="height: 200px"></td>
        </tr>
        <tr>
            <td style="width: 38%"></td>
            <td style="width: 20%; height: 175px; text-align: center; vertical-align: middle">
                <asp:Image ID="update" runat="server" ImageUrl="img/loading.gif" />
            </td>
            <td style="width: 40%"></td>
        </tr>
    </table>
</div>
</div>

On this actual form, works perfectly, but i want to put this in place on same UserControl to avoid redundancy: 在这种实际形式上,可以完美地工作,但是我想将其放在同一UserControl上以避免冗余:

function progress() {
    var win = $.messager.progress({
        title: 'Please waiting',
        msg: 'Loading data...'
    });
    setTimeout(function () {
        $.messager.progress('close');
    }, 5000)
}

and that this event trigger as the current is. 并且该事件将在当前触发。 Anyone can help me with this? 有人可以帮我吗?

PS: its important that this event stay on UserControl, because this same event will be used in dozens of pages in project. PS:此事件留在UserControl上很重要,因为同一事件将在项目的数十个页面中使用。

PS2: i don't use master page because i prefer to use loose coupling between the pages, to facilitate the diverse between them. PS2:我不使用母版页,因为我更喜欢在页面之间使用松散耦合,以促进页面之间的差异。

Solved! 解决了!

I put a javascript handler on begin and end of postback to control the time of animation. 我在回发的开始和结束处放置了一个javascript处理程序,以控制动画的时间。

Here's the EX: 这是EX:

<script>
    Sys.Application.add_init(appl_init);

    function appl_init() {
        var pgRegMgr = Sys.WebForms.PageRequestManager.getInstance();
        pgRegMgr.add_beginRequest(BeginHandler);
        pgRegMgr.add_endRequest(EndHandler);
    }

    function BeginHandler() {
        var win = $.messager.progress({
            title: 'Please waiting',
            msg: 'Loading data...'
        });
        setTimeout(function () {
            $.messager.progress('close');
        }, 9999)
    }

    function EndHandler() {
        $.messager.progress('close');
    }
</script>

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

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