listbox not updating with update control and timer

h4ck-y0u

New Member
I have a problem. I putted the updatecontrol timer and a script manager. Timer works but my listbox is not refreshing or updateing on page:Here is code\[code\] <asp:UpdatePanel ID="UpdatePanel1" UpdateMode="Conditional" runat="server"> <ContentTemplate> <asp:Timer ID="Timer1" runat="server" Interval="1000" OnTick="Timer1_Tick"> </asp:Timer> <asp:ListBox ID="ListBox1" runat="server" EnableViewState="true" AutoPostBack="true" BackColor="#C440D4" DataSourceID="dataOperators" DataTextField="userid" DataValueField="userid" Font-Size="Medium" ForeColor="White" Height="336px" OnSelectedIndexChanged="ListBox1_SelectedIndexChanged" Width="260px"></asp:ListBox> <asp:SqlDataSource ID="dataOperators" runat="server" ConnectionString="<%$ ConnectionStrings:vProtectConnectionString %>" SelectCommand="SELECT DISTINCT guests.userid FROM messages,guests WHERE guests.userid = messages.userid AND guests.online='online' AND (messages.IDO=@ido)"></asp:SqlDataSource> </ContentTemplate> </asp:UpdatePanel>\[/code\]here is a event:\[code\] <script runat="server" type="text/c#"> protected void Timer1_Tick(object sender, EventArgs e) { ListBox1.DataSource = null; ListBox1.Items.Clear(); }</script>\[/code\]timer clears every item in listbox but on page all the items are still there...Can anyone help?
 
Back
Top