Click here to Skip to main content
15,888,802 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using update panel,timer and trigger to show top 5 songs of the week one by one but due to the Timer_Tick event of the trigger the whole web page is not working fine means when I slide the scroller down it automatically comes up means the page is getting refreshed and due to which scroller automatically comes to its initial position.I am writing the code below.Please give any suggestion where I'm going wrong.
Thanx in advance.




ASP.NET
  <asp:Timer ID="Timer1" runat="server" Interval="2000" OnTick="Timer1_Tick">
  </asp:Timer>
                                
 <asp:ScriptManager ID="ScriptManager1" runat="server">
 </asp:ScriptManager>
                                 
 <asp:UpdatePanel ID="UpdatePanel1" runat="server">
 <Triggers>
           <asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" />
                                        
 </Triggers>
 <ContentTemplate>
                                        
                                        
 <div style="width: 8em; height: 6em; margin-removed 1em; margin-removed 5em; margin-removed 1em;">
 <asp:ImageButton ID="imgbtn1" runat="server" Height="81px" ImageUrl="~/images/img1.jpg"
 Width="88px" />
 </div>
 <div style  ="width: 15em; height: auto; margin-removed 0.5em; margin-removed 4.5em;">
 <asp:HyperLink ID="hyperlinkfirstName" runat="server" ForeColor="Maroon" NavigateUrl='<%#"~/Tutor_Profile.aspx?Tutor_User_Id=" + Eval("User_Id")%>'></asp:HyperLink>
                                            
<asp:HyperLink ID="hyperlinklastname" runat="server" ForeColor="Maroon" NavigateUrl='<%#"~/Tutor_Profile.aspx?Tutor_User_Id=" + Eval("User_Id")%>'></asp:HyperLink>
 </div>
 <div style="width: 14em; height: auto; margin-top: 0.5em; margin-left: 1em; float: none;
 margin-right: 0.5em;">
<asp:Label ID="lblsubjects" runat="server" ForeColor="Black"></asp:Label>
</div>
<pre lang="HTML">
Posted
Comments
Hemant Singh Rautela 29-Mar-13 3:27am    
Put timer tag also in update panel & which songs to show on timer event also put in update panel......
[no name] 29-Mar-13 4:04am    
but sir timer tag doesn't work in Update panel
Hemant Singh Rautela 29-Mar-13 4:08am    
I already work timer within update panel see my blog it is working code...

http://hemantrautela.blogspot.com/2012/09/timer-ajax-control-cnet-aspnet.html
Sarvesh Kushwaha 29-Mar-13 3:30am    
control your time from causing post .. put it in update panel as well ..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900