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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T22:26:54+00:00 2026-05-31T22:26:54+00:00

I have a webpage where users can look for clients and select them. After

  • 0

I have a webpage where users can look for clients and select them. After selection they can be send to the webserver through an jQuery Ajax call. On the server database operations and another webservice is called, so this can take a while. That is why I wanted to present a progress bar to the user.

This progressbar is also updated by a Ajax call.

The problem seems to be that asp.net doesn’t allow concurrent calls and the session state queues all calls. You can solve this in mvc by setteing the attribute [SessionState(SessionStateBehavior.ReadOnly)]

But I don’t find to do this in my page-behind webmethods. Anyway, the worker method is using session state (for security, and updating the session variable for the progressbar).
The progress method is only reading and returning the session variable.

Is there a solution for it, or is another approach necessary?

I am using asp.net 4.

  • 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-31T22:26:55+00:00Added an answer on May 31, 2026 at 10:26 pm

    I have found the solution:

    1) The WebMethod only needs to receive the data and start a new thread:

    <WebMethod()> _
    Public Shared Function importContacts(ByVal contactGuids As String, ByVal campaignGuids As String) As String
      Dim paramsList As New List(Of Object)
    
      paramsList.Add(contactGuids)
      paramsList.Add(campaignGuids)
      paramsList.Add(HttpContext.Current.Session)
    
      Dim th As New Threading.Thread(AddressOf processImport)
    
      th.Start(paramsList)
    
      Return ""
    End Function
    

    The Ajax call is ended quickly and on the browser you can start polling for progress.

    2) The thread function needs to convert the parameters first, then you can use the session state:

    Public Shared Sub processImport(params As Object)
      Dim paramsList As List(Of Object) = params
      Dim contactGuids As String = paramsList(0)
      Dim campaignGuids As String = paramsList(1)
      Dim _session As HttpSessionState = paramsList(2)
    
      _session("EmailMarketingDatabase_progress") = 0
      ...
    End Sub
    

    3) The progress WebMethod looks like this:

    <WebMethod()> _
    Public Shared Function getProgressStatus() As Integer
      Return HttpContext.Current.Session("EmailMarketingDatabase_progress")
    End Function
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a text box on my webpage. Users can input text there which
I have a javascript backed 'print' button on my webpage where the user can
I have code that sends emails to users from a signup webpage. Occasionally, users
i have a database fill with information of the users who use my webpage.
I have a webpage that dynamically loads a user control. Each user control can
Database resources, that can be accessed from webpage that I'm currently working on, have
I have a webpage where I want the user to see a new image
I have an ASP.NET webpage running under IIS that uses a common assembly that
I have written a program that uses qhttp to get a webpage. This works
I have a requirement to allow users to open word document from web page

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.