如何在网格视图中点击按钮后禁用页面内的UpdateProgress

时间:2014-03-27 08:51:42

标签: asp.net ajax updatepanel

我有一个网格视图,在里面我使用了更新面板,因为在其中使用了文件上传,我使用了触发方法。我想要的是当用户点击网格视图中的按钮时有一个很好的更新进度。我需要禁用页面并显示下载动画。如下图所示。但是不是对话框消息,而是加载 动画必须出现。它可以解决吗?

enter image description here

这是我用过的鳕鱼,但它不起作用:

 <ContentTemplate>
                                <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                                    <ContentTemplate>
                                        <asp:ScriptManager ID="ScriptManager1" runat="server">
                                        </asp:ScriptManager>
                                        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" onrowdatabound="GridView1_RowDataBound"
                                            DataKeyNames="ID,ArticleID,UserName" DataSourceID="SqlDataSource1" 
                                            GridLines="Vertical" AllowPaging="True" PageSize="5" OnRowUpdating="GridView1_RowUpdating">
                                            <Columns>
                                                <asp:TemplateField>
                                                    <ItemTemplate>
.......some stuffs 



                                 </ItemTemplate>
                                                </asp:TemplateField>
                                            </Columns>

                                        </asp:GridView>
                                    </ContentTemplate>
                                    <Triggers>
   <asp:PostBackTrigger ControlID="Gridview1" />
</Triggers>


                            </asp:UpdatePanel>

我也用过这个:

.Background

    {

        position: relative;

        left: 0;

        top: 0;

        z-index: 10;

        width: 100%;

        height: 100%;            

        filter: alpha(opacity=40)

    }

这个

<asp:UpdateProgress ID="UpdateProgress4" runat="server" AssociatedUpdatePanelID="UpdatePanel1">

                    <ProgressTemplate>

                    <DIV id="IMGDIV" align="center" valign="middle" runat="server" style=" position: relative; visibility:visible;  vertical-align:middle;  border-style :inset;border-color:black;background-color:white;z-index:40; top:45%;">

                    <img src="../images/NewLoader.gif" /><br />

          <%--      <input type="button" onclick="CancelPostBack()" value="Cancel" />--%>

                  </DIV>

                    </ProgressTemplate>

</asp:UpdateProgress>

1 个答案:

答案 0 :(得分:1)

I think you have to use    
        <asp:AsyncPostBackTrigger>         
    not         
     <asp:PostBackTrigger >        

<asp:UpdateProgress> will work only for Async calls.