开发者

ASP.NET Ajax UpdatePanel flicker

开发者 https://www.devze.com 2023-01-23 01:09 出处:网络
Here\'s my code <asp:LinkButton 开发者_开发技巧ID=\"createChart\" runat=\"server\" OnClick=\"createChart_onClick\"></asp:LinkButton>

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?


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.


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>
0

精彩评论

暂无评论...
验证码 换一张
取 消