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

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Ajax timer affecting CPU performance

Posted By:      Posted Date: October 14, 2010    Points: 0   Category :ASP.Net



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:

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 timer issue



              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??





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

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?

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?


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" %>

Microsoft AJAX CDN

Content delivery networks (CDNs) are composed of "edge cache" servers that are strategically placed around the world at key Internet network points. These "edge cache" servers can be used to cache and deliver all types of content - including images, videos, CSS and JavaScript files.

Using a CDN can significantly improve a website's end-user performance, since it enables browsers to more quickly retrieve and download content. For example, instead of having a browser request for an image traverse all the way across the Internet to your web server to download, a CDN can instead serve the request directly from a nearby "edge cache" server that might only be a single network hop away from your customer (making it return much faster - which makes your pages load quicker).

AJAX GridView Checkbox Select All in ASP.Net

In the previous article GridView Select Multiple Rows you learnt the multiple row selection in GridView control. Here you will get the C# code sample to select all the gridview rows using single checkbox server control. You can highlight the selected rows with different color and Font state Bold. If you want to use the selection values on different ASP.Net

AJAX GridView Paging and Sorting using C# in ASP.Net

To enable the GridView Paging and Sorting to update the GridView Data without refreshing the ASP.Net web page AJAX Extension controls are used. UpdatePanel is used to hold the GridView control that triggers the events for the controls placed inside it. By Default UpdatePanel triggers the asynchronous postbacks for its child controls.

GridView Paging Using Ajax in ASP.Net

To enable the GridView Paging and Sorting to update the GridView Data without refreshing the ASP.Net web page AJAX Extension controls are used. UpdatePanel is used to hold the GridView control that triggers the events for the controls placed inside it. By Default UpdatePanel triggers the asynchronous postbacks for its child controls.

ASP.NET Best Practices for High Performance Applications

This article lists the techniques that you can use to maximize the performance of your ASP.NET applications. It provides common issues, design guidelines, and coding tips to build optimal and robust solutions.

jQuery $(document).ready() and ASP.NET Ajax asynchronous postback

Many call it the ASP.NET jQuery postback problem, but using the technique below should make it no problem anymore. $(document).ready() isn't called after an asynchronous postback. What this means? You lose the functionality that should be executed within $(document).ready() after an UpdatePanel rendered its contents after an asynchronous postback.

Making Ajax Callbacks to the Server Using jQuery with ASP.NET

In the first part of this article series I introduced jQuery's functionality and how it provides a rich client side programming model. This time around I'll expand on these concepts and show you how you can use jQuery in combination with ASP.NET using it as an AJAX backend to retrieve data. I'll also discuss how you can create ASP.NET controls and otherwise interact with jQuery content from ASP.NET pages in WebForms.

jQuery is just a JavaScript library so it will work seamlessly with ASP.NET both from page code as well as through backend driven code using the Page.ClientScript object or ScriptManager. You can use jQuery on its own as a client side and Ajax library that communicates with ASP.NET or you can use jQuery in combination with ASP.NET AJAX. The two actually complement each other quite well as jQuery provides functionality that the ASP.NET AJAX library does not and vice versa. For the most part the interaction between the two libraries is trouble free except for a few very rare edge cases.
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