473,378 Members | 1,500 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

tick event not work in asp ajax 2.0

I am unable to change the ads in adrotator placed inside the update panel. for some reason timer1_click event is not firing.

Expand|Select|Wrap|Line Numbers
  1. f<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="adrot.aspx.cs" Inherits="_Default" %>
  2.  
  3. <%@ Register
  4.     Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
  5.     Namespace="System.Web.UI" TagPrefix="asp" %>
  6.  
  7.  
  8.  
  9. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  10.  
  11. <html xmlns="http://www.w3.org/1999/xhtml" >
  12. <head runat="server">
  13.     <title>Untitled Page</title>
  14. </head>
  15. <body>
  16.     <form id="form1" runat="server">
  17.     <div>
  18.  
  19.  <asp:ScriptManager ID="ScriptManager2" runat="server" />
  20. <asp:Timer ID="Timer1"  Interval="2000" runat="server"  OnTick="Timer1_Tick1" />
  21.  
  22. <asp:UpdatePanel ID="up1" runat="server">
  23. <Triggers>
  24. <asp:AsyncPostBackTrigger ControlID="Timer1"  EventName="Tick" />
  25. </Triggers>
  26. <ContentTemplate>
  27. <asp:Label ID="Label1" runat="server" Text="UpdatePanel1 not refreshed yet."></asp:Label>
  28. <asp:AdRotator
  29. id="AdRotator1"
  30. AdvertisementFile="~/App_Data/Ad1.xml"
  31. KeywordFilter="small"
  32. Runat="server" />
  33. </ContentTemplate>
  34. </asp:UpdatePanel>
  35.  
  36.  
  37.     </div>
  38.     </form>
  39. </body>
  40. </html>
--------------------------------------------------------------------------------------------------------------
Expand|Select|Wrap|Line Numbers
  1. using System;
  2. using System.Data;
  3. using System.Configuration;
  4. using System.Web;
  5. using System.Web.Security;
  6. using System.Web.UI;
  7. using System.Web.UI.WebControls;
  8. using System.Web.UI.WebControls.WebParts;
  9. using System.Web.UI.HtmlControls;
  10.  
  11. public partial class _Default : System.Web.UI.Page 
  12. {
  13.     protected void Page_Load(object sender, EventArgs e)
  14.     {
  15.  
  16.     }
  17.  
  18.     protected void Timer1_Tick1(object sender, EventArgs e)
  19.     {
  20.         up1.Update();
  21.     }
  22. }
----------------------------------------------------------------------------------------------------------
Expand|Select|Wrap|Line Numbers
  1. <?xmlversion ="1.0"encoding="utf-8" ?>
  2. <Advertisements>
  3.   <Ad>
  4.     <ImageUrl>~/Images/ad1_1.jpg</ImageUrl>
  5.     <NavigateUrl>http://www.dotnetcurry.com</NavigateUrl>
  6.     <AlternateText>DotNetCurry Home Page</AlternateText>
  7.     <Impressions>40</Impressions>
  8.     <Keyword>small</Keyword>
  9.   </Ad>
  10.   <Ad>
  11.     <ImageUrl>~/Images/ad1_2.jpg</ImageUrl>
  12.     <NavigateUrl>http://www.sqlservercurry.com</NavigateUrl>
  13.     <AlternateText>SQL Server Curry Home Page</AlternateText>
  14.     <Impressions>20</Impressions>
  15.     <Keyword>small</Keyword>
  16.   </Ad>
  17.   <Ad>
  18.     <ImageUrl>~/Images/ad1_3.jpg</ImageUrl>
  19.     <Width>300</Width>
  20.     <Height>50</Height>
  21.     <NavigateUrl>http://www.dotnetcurry.com/writeforus.aspx</NavigateUrl>
  22.     <AlternateText>dotnetcurry.com Write For Us</AlternateText>
  23.     <Impressions>40</Impressions>
  24.     <Keyword>small</Keyword>
  25.   </Ad>
  26. </Advertisements>
Dec 28 '09 #1
2 3424
tlhintoq
3,525 Expert 2GB
TIP: When you are writing your question, there is a button on the tool bar that wraps the [code] tags around your copy/pasted code. It helps a bunch. Its the button with a '#' on it. More on tags. They're cool. Check'em out.
Dec 28 '09 #2
Frinavale
9,735 Expert Mod 8TB
Have you placed a break point on the Timer1_Tick1 method to see if it's ever reached?

Have you tried specifying that Timer1 is Enabled (in your aspx code)?

-Frinny
Jan 4 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: J. Hill | last post by:
I have a Windows Service with a timer but the .Tick event is not being fired/called. Don't know what code to include...I enabled and started the timer...I have the exact same code in a Windows...
7
by: utkarsh | last post by:
Hi, I am using the following code to the update a section of the image which is drawn on a panel. this.m_Timer = new System.Windows.Forms.Timer(this.components); this.m_Timer.Tick += new...
4
by: Dan | last post by:
Hi, I have a timer on a form (System.Windows.Forms.Timer - Framework 1.1) that is set to 60 seconds as sort an of inactivity monitor. If 60 seconds have elapsed without any user activity I want...
4
by: Winista | last post by:
I have a page with bunch of user controls and standard controls on the page. And then I have a Button control on the page which is used to save the data on server side. All was working fine and...
19
by: Daniela Roman | last post by:
Hello, I try to fire an event under a button click event and maybe anybody can give a clue please. I have let's say a WEB grid with PageIndexChanged event: private void...
0
by: kloppie | last post by:
Hi there, im using ASP.NET AJAX to update a GridView, using the UpdatePanel and the Timer. What I would like is to update a Label on the page with the last time of update. But it should be the...
0
by: kloppie | last post by:
Hi, im trying to update a Label after a ajax:Timer Tick has occured. Each timer tick makes an async reguest to the server and a UpdatePanel is updated. The problem is that i want to display the...
5
by: jitendra_jkr_mca05 | last post by:
hi, I am developing a window application using c#.net. In the main MDI Form i used a timer, and in timer's tick event i have done some neccessary work. In this form I also used notifyicon to...
16
by: AAaron123 | last post by:
I have a timer. At each tick, say 0.1 second, I write a file. If it takes more than 0.1 second to write the file the app will not work correctly. How can I tell in the tick event if the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.