Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 780425
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T20:04:15+00:00 2026-05-14T20:04:15+00:00

I have an asp.net page where two grid views are available showing current stock

  • 0

I have an asp.net page where two grid views are available showing current stock market price updates. I need to update these two grid views every 20 seconds. So I was thinking of using JQuery to do this job.

What I need is a timer which will fire every 20 seconds, send an ajax request to the servers, bring the order lists from the server using json and then update those two grid views. If a request to the server is still being served 20 seconds after it is fired, then I want the old one to be aborted without causing any trouble.

I already know how to bring objects using json. I just need to figure out how to send a request every 20 seconds and cancel a request if it is still being server for 20 seconds.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T20:04:16+00:00Added an answer on May 14, 2026 at 8:04 pm

    Use javascript’s setInterval() to run some code at an interval.

    jQuery’s $.ajax() will return the XMLHTTPRequest object that you can abort.

    var request;    // Stores XMLHTTPRequest object
    
    setInterval(function() {
                     // if there's a current request, abort
                  if(request) request.abort();
    
                    // make ajax request, and assign request to variable
                  request = $.ajax({
                         // My ajax request parameters
                  });
    
    }, 20000);       // repeat every 20 seconds (20,000 milliseconds)
    

    http://api.jquery.com/jQuery.ajax/


    EDIT:

    If you ever need to stop the interval from running, you need to assign the interval to a variable, and then clear it whenever you want.

    var theInterval = setInterval(function() {...}, 20000);
    
    theInterval.clear();   // To stop the interval from running
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an ASP.NET page that contains two div's. Both have search fields and
I have a C#/ASP.NET .aspx page that declares two controls that each represents the
I have two instances of an Address.ascx control in an ASP.NET MVC page. <h1>Shipping
I have an ASP.NET page where I am showing products in a Gridview control.
I have two dropdowns and a gridview (lstDivisions, lstDistricts, gridIncidents) in an asp.net page
I have a DDL and a ASP .net Grid view in my aspx page.
So I have an ASP.NET page with two controls: a GridView which displays rows
Suppose I have a grid view in an asp.net web page, where I am
I've got a ASP.NET 3.5 sp1 site, and on one page I have two
I have an ASP.NET page that has two input elements: A TextBox that is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.