Click here to Skip to main content
15,896,606 members

How to stop refreshing whole page while using timer & trigger in asp.net

jackson kumar asked:

Open original thread
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">
Tags: C#, .NET, ASP.NET

Plain Text
ASM
ASP
ASP.NET
BASIC
BAT
C#
C++
COBOL
CoffeeScript
CSS
Dart
dbase
F#
FORTRAN
HTML
Java
Javascript
Kotlin
Lua
MIDL
MSIL
ObjectiveC
Pascal
PERL
PHP
PowerShell
Python
Razor
Ruby
Scala
Shell
SLN
SQL
Swift
T4
Terminal
TypeScript
VB
VBScript
XML
YAML

Preview



When answering a question please:
  1. Read the question carefully.
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  3. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
  4. Don't tell someone to read the manual. Chances are they have and don't get it. Provide an answer or move on to the next question.
Let's work to help developers, not make them feel stupid.
Please note that all posts will be submitted under the http://www.codeproject.com/info/cpol10.aspx.



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