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 9259525
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T12:40:43+00:00 2026-06-18T12:40:43+00:00

When calling WebMethod on a Webpage using jQuery. We define this as static. However

  • 0

When calling WebMethod on a Webpage using jQuery. We define this as static.

However static methods always have one instance. What happens when multiple web requests are made.

  1. Does it really happen asynchronously or
  2. all the requests are pipelined waiting for the WebMethod to accept the requests?

I created a sample console program to simulate the scenario on static method work & found them to execute in sequential order.

class Program
{
    static int count = 10;
    static void Main(string[] args)
    {
        new Program().foobar();

        Console.ReadLine();
    }

    public void foobar()
    {
        Parallel.Invoke(() => work("one"), () => work("two"), () => work("three"), ()=> work("four"));
    }

    static void work(string str)
    {
        Thread.Sleep(3000);
        count++; 
        Console.WriteLine(str + " " + count);
    }
}

Can you please put some light on this concept?

  • 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-06-18T12:40:44+00:00Added an answer on June 18, 2026 at 12:40 pm

    They will not execute sequentially. If you created multiple apps in a client server scenario it would be a better example since your console app inherently runs everything sequentially.

    That said, with the static methods you just need to be aware of shared resources, data, etc. Local data is fine.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm calling a webmethod using jquery, the webmethod returns a chunk of HTML that's
I'm calling a page method using a jquery function that's somewhat like this: function
I am trying to call a PageMethod using jQuery like this: [WebMethod] public stataic
I am calling a WebMethod from this code: if($(this).attr(checked)) { .. MyWebMethod(variable1, variable2, onSuccessFunction);
I have a web service that has one method: [WebMethod] public bool SyncUserData(string userxml)
I am calling a specific WebMethod from client side like this: function openSmallPopup(int) {
I am calling a WebMethod() using $.ajax() and it doesn't seem like the VB
I've got a WebMethod that I'm calling from jQuery AJAX. No matter what I
I'll start from my problem: I have a webmethod that I'm calling via AJAX/JSON.
Inside my ASP.NET website I am calling a Web Method using Jquery as follows:

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.