ASP.NET Ajax UpdatePanel flicker

旧时模样 提交于 2019-12-11 11:51:45

问题


Here's my code

<asp:LinkButton ID="createChart" runat="server" OnClick="createChart_onClick"></asp:LinkButton>
<asp:UpdatePanel ID="result" runat="server" UpdateMode="Conditional">
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="submit" />
            </Triggers>
            <ContentTemplate>
                <!-- content -->
            </ContentTemplate>
</asp:UpdatePanel>

It works great. My problem is that every now and then i see a white flicker sometime in between a request and a response. It's a little annoying. Is this a common occurrence or could it be because of some other javascript on my page?


回答1:


In Chrome you will see a flicker with the UpdatePanel if your ajax response contains image urls. I noticed that this flicker did not occur with Safari, Firefox or Safari mobile but just Chrome and stopped when I removed <img src="/images/photo.png" /> from ajax response content.




回答2:


You can easily improve it using UpdateProgress.

<asp:UpdateProgress ID="updLoading" DisplayAfter="2500" runat="server" AssociatedUpdatePanelID="updContent">
 <ProgressTemplate>
    <img src="../../Images/ajax-loader.gif" align="middle" />
           Loading.  Please Wait...
 </ProgressTemplate>
</asp:UpdateProgress>


来源:https://stackoverflow.com/questions/4085090/asp-net-ajax-updatepanel-flicker

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!