.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Post New Web Links

Ajax timer issue

Posted By:      Posted Date: September 23, 2010    Points: 0   Category :ASP.Net


              I have an timer outside of UpdatePanel that refreshes every 30 seconds. In the timer's OnTick function, I check the status of some operation from database. If the operation is complete i disable the timer otherwise I enable it. I call timer.Enabled = true. will this cause problem, until the process is complete I keep setting timer.Enabled = true. What happens is that after few hours when multiple users do the same operation the database connection goes down and I cant connect to database at all. the database connection and recordset are closed everytime I checked it.. Any clues on this issue??





View Complete Post

More Related Resource Links

Why ASP.Net AJAX Timer control stops ticking when we right click on the page?

Asp.Net AJAX Timer control stops ticking when I right click on the page. Actually i am updating a label using timer control for every second. When I right click on the page the label is not getting updated. I mean the timer stops ticking. Please tell me what is actually happening and how can i resolve it.

two ajax needs - first timer

Hello,I have not used ajax yet. I use both VS 2008 and VS 2010. I have the ajax control toolkit installed. There are two primary things I need ajax for:1. visual feedback that a search is running. I've seen this on many apps, I need the whole page to be dimmed, and some simple animation to play indicating work is being done.2. I need to setup a master/detail view where when a user selects a row from the master datagrid, the detail view (either a formview or a detailview control, not sure which yet) will appear below it showing the further detail info of that selected row, without full page postback. I will actually have a few different 'detail view' controls, because depending on the type of record they select from the parent datagrid control, the detail view will have a different set of data, as in different schema, not just a different record. So I will need to check the 'type' of record selected in the parent, and then dynamically show the appropriate detail data in the appropriate detail view control. Again, no full page postback, and the same visual indication that work is being done like in my number 1, only this time just showing a simple animation in the section below the parent grid where the detail data is soon to appear, not the full page dimming thing.Those are my two goals. I'm completely new to ajax. Could someone let me know which ajax con

Ajax issue: delay in getting data from web service using innerHTML, please guide

I am working on an ajax application which will display about a million records in an html table. Web service returns records from server, I build a logn string by concatinating data and tags and than put this string using innerHTML (not using DOM for getting better performance). For testing I have put 6000 recods in database (stored procedure takes about 4 seconds in completion of its execution). While testing on local system (database and application on same machine) it took about 5 minutes to display the records in page. After deplying on web server it did not responde even for more time. It looks very low performance. I put records in a CSV file and its weight was less than 2 MB. I couldn't understand why string concatinations to build html table and putting string in innerHTML is taking such a huge time (if it is the issue). Requiment is to show about million records in web page but performance on just 6000 records is disappointing. I am not gettign what to do to increase performance. Kindly guide me and help me.  

AJAX Upgrade Issue


We have a DNN site and we use the AJAX Toolkit.  We upgraded from AJAX 30930 to 40412.  We changed the script manager to a ToolkitScriptManager.  I have a image button that posts back and calls a modal popup.show() method.  When I click the button I get a javscript error before the post back:

Error: Sys.WebForms.PageRequestManagerServerErrorException: This version of MicrosoftAJAX does not offer the ScriptManager.RegisterClientScriptBlock method.

Any suggestions would be helpful.  I will obviously provide more detail if needed.

Ajax timer affecting CPU performance




I'm using an ajax timer to show different time zones. Also, I'm placing ajax timers to update user controls on my page.

For example, I'm placing 3-4 timers on my page to update my user controls and displaying various time zones. My problem is

this is badly affecting my CPU performance. It is using 20-30% CPU usage. I tried increasing the timer interval from one sec to

6 seconds. This fairly improved the performance. Is there any other way of improving CPU performance ?


I'm updating my user control like this:

<asp:UpdatePanel ID="updateGradeTable" runat="server"  UpdateMode="Conditional">
     		<uc1:GradeTable ID="gradeTable" UpdateMode="Conditional" runat="server" />
                <asp:Timer ID="tm1" runat="server" OnTick="tm1_Tick" Interval="7000"></asp:Timer>
I'm updating my timer like this:

AJAX Control Toolkit - Rating Issue



I have implented the AJAX Control Toolkit and added the Rating Control to my page. It displays exactly as it should and even performs postback correctly, however it refuses to do anything on mouseover. The stars just continue to display whatever I set as the 'Current Rating'.

Here is the code I'm using; I believe I've correctly stripped out anything that's irrelevant:

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>


<style type="text/css"> /* Rating */ .ratingStar { font-size: 0pt; width: 13px; height: 12px; margin: 0px; padding: 0px; cursor: pointer; display: block; background-repeat: no-repeat; } .filledRatingStar { background-image: url(Images/FilledStar.png); } .emptyRatingStar { background-image: url(Images/EmptyStar.png); } .savedRatingStar { background-image: url(Images/SavedStar.png); } </style>
<form id="form1" runat="server&q

how to add multiple ajax ratings issue...


I am using visual studio 2008 C# 2.0. I have an issue adding multiple ratings...What i have of code so far is:


im adding this to datalist:

  <cc1:Rating ID="LikeRating" runat="server"
                    style="float: left;">
    </cc1:Rating><br />



 protected void r_Changed(object sender, AjaxControlToolkit.RatingEventArgs e)

        Rating r = (Rating)sender;
        string id = r.ClientID;

        string s = e.Value;


and this is some of the xml file:


<entry... (some other attributes comes here)... ... ratingid="Guestbook_ctl00_r" ratingclicks="3" ratingresult="9">some text comes here..</entry>

so now the problem is how can i control ever

Calling a javascript function from server side, using AJAX timer



I am developing a ASP.NET ajax application.
I am using a timer:

<asp:Timer ID="Timer1" runat="server" OnTick="Timer_Tick" Interval="5000" />      

The only thing I want to do is to call a javascript function on every tick of the timer:

 protected void Timer_Tick(object sender, EventArgs e)
            ClientScript.RegisterClientScriptBlock(this.GetType(), "blink", "<script>blinkit('2');</script>");

This doesn't work.
The javascript function is being called only if I put the 'RegisterClientScriptBlock' in the Page_Load.

How can I call the javascript every couple of seconds?

Thank you

Integration issue with ajax toolkit


My application sets the css styesheet via code.  The <link> statement below is how it is set.

On my main form, I had to add the runat=server tag on the <head> in order to get my Editor control to work.  When I add runat=server, the stylesheet no longer gets set.  When I look at the source, the "<%" is changed to "&lt;%" (second line below).  I assume this is why my stylesheet is not being set.  How do I repair this?

<link href="<%= _stylesheet %>" type="text/css" rel="stylesheet" />

<link href="&lt;%= _stylesheet %>" type="text/css" rel="stylesheet" />


Ajax Timer


i'm sorry for my bad redaction
I have a Timer in  my master page but when change a content page,the  timer 
I want  the timer "keep alive"  through change of content pages,how can i do this?

Ajax HtmlEditor issue


Dear All,

Im using htmleditor to let the use of my website to create articles and save it into the database..that's going well, however when i display the articles in the website, the longer lines of the text spill out of the box of the control that displays the content of the article. i tried the label, literal, gridview, html div, html table, nothing works probably..

please some help!


Thanks in advance.


Reverse AJAX vs Timer


What is the best way to update data constantly on the client using asp.net Timer + Update Panel, or I need to use Reverse AJAX for that?


Ajax issue on VS2005


 Hi All,

I just come across a pretty weird behaviour on my VS 2005 and Ajax, basically i am having a master page and a content page. This is the front end html code for the master page:

<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="MasterPage.master.cs" Inherits="WebApplication3.MasterPage" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc" %>
<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI" TagPrefix="asp" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Test Page</title>
    <link href="Stylesheet1.css" rel="stylesheet" type="text/css" /> 
    <form id="form1" runat="server">
    <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">

how to create a countdown timer using C# and ASP.NET AJAX ?


 Hi guys,

Im about to start development on a countdown timer that will display the time left for a particular product.

the format will be like this - 00:00:11.

I have been watching the AJAX video tutorials so im thinking of approaching this by setting an updatePannel with a timer with a tick event every 1000ms. Inside the updatePannel i could have a label that is attached to a C# method that contains the countdown logic

2 questions...

1: is this a good way forward or not.

2: can anyone suggest data time classes/methods that i will find useful so for example an admin can enter a start date and an end date and the timer will show the days, hours, minutes and seconds remaining.

the site im trying to emulate is this ... http://www.telebid.com/ looks like they have AJAX countdown timers too.

thank you for your help


Flickering Problem while using a Ajax Timer Control to refresh a chart control in asp.net2010

Hi Everybody ,  

I am facing a flickering issue when i am trying to refresh a chart control on the tick of a timer .I am listing

below the code of my application ,Please help me remove this problem so that chart control get refreshed without any flickers on the specified time interval

Thanks in advance.

 C# code:

public partial class _Default : System.Web.UI.Page
    protected void Page_Load(object sender, EventArgs e)
        if (!Page.IsPostBack)
            MyLabel.Text = System.DateTime.Now.ToString();
            Txt1.Text = "Mohit";

    protected void Timer1_Tick(object sender, EventArgs e)

        Label1.Text = "Grid Refreshed at: " + DateTime.Now.ToLongTimeString();

    public void BindData()
        DateTime st = new DateTime(2010, 6, 1);
        int dys = 12;
        Dictionary<DateTime, long> dict = GetData(st, dys);

        foreach (DateTime d in dict.Keys)
            string xlab = d.ToString("M/d");

            DayOfWeek wd = d.DayOfWeek;
            if (wd == DayOfWeek.Sunday || wd == DayOfWeek.Saturday)
                Chart1.Series["weekends"].Points.AddXY(xlab, dict[d]);

JScript runtime error 12030 from ajax timer when authorization expires...


 I have an ASP.NET form with several update panels.  All works great.

I use a timer and have it handle some periodic upates.  That works correctly too.  However, I appear to get an error when I leave the page open running in the debugger.  Specifically the above JScript error 12030.

I'm not clear how to find the source but I assume it is because my page has logged out.  If I refresh I go back to my login page.

So, does this sound like the cause?  If so, how to I address this?


Using AJAX timer to refresh data


I am writing a ASP.NET C# application and using a AJAX timer in order to refresh some if the data every couple of seconds.

Whenever the timer function is called, it looks like the whole page is rendered again. For example, I have a list of tabs, the selected tab is not selected anymore.

I need to keep the selected tab 'selected' after refresh.

How can I achieve that?
I am attaching the relevant code.

my aspx:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="test.aspx.cs" Inherits="InternalMonitorTool.test" %>
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend