c# - listbox not updating with update control and timer -
i have problem. putted updatecontrol timer , script manager. timer works listbox not refreshing or updateing on page: here 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 messages,guests guests.userid = messages.userid , guests.online='online' , (messages.ido=@ido)"></asp:sqldatasource> </contenttemplate> </asp:updatepanel> here event:
<script runat="server" type="text/c#"> protected void timer1_tick(object sender, eventargs e) { listbox1.datasource = null; listbox1.items.clear(); } </script> timer clears every item in listbox on page items still there... can help?
Comments
Post a Comment