我在 UpdatePanel 中放置了一个 GridView 和一个计时器。现在的问题是,每次计时器刷新 GridView 中的图像时都会闪烁。有人知道为什么吗?这是我的代码:
<asp:UpdatePanel ID="UpdatePanel3" runat="server" UpdateMode="Conditional">
<ContentTemplate>
</asp:Timer>
<asp:Timer ID="Timer1" runat="server" Interval="100" OnTick="Timer1_Tick">
</asp:Timer>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:masterConnectionString3 %>" SelectCommand="[GET DATA FROM SQL SERVER]"></asp:SqlDataSource>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="4" DataSourceID="SqlDataSource1" ForeColor="Black" GridLines="None" Width="940px">
<Columns>
<asp:BoundField DataField="Column1" HeaderText="Column1" HtmlEncode="False" ReadOnly="True" SortExpression="Column1" />
<asp:BoundField DataField="Column2" HeaderText="Column2" ReadOnly="True" SortExpression="Column2" />
</Columns>
</asp:GridView>
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />
</ContentTemplate>
</asp:UpdatePanel>