473,326 Members | 2,588 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

background thread after page is being rendered

recently I have to create a search engine that will pick up stuff form
different external source. they will be divided into sections(tabs). My
idea is:
1. Multithread (Default Tab content with Highest Priority, rest with
low)
2. Once the default tab is done it will render the page
2. On the background:It will get the rest of the data and put into
session variable
3. When user click on different section (PostBack). it will check the
SESSION variable if the data is ready.
4. If it does ... perform the databinding process.

my problem is after the page is being render and display to the client.
and from debug mode it went though the process of adding to data to the
SESSION variable. but when User click on different section the SESSION
variable remain the same.

Nov 19 '05 #1
2 1440
the background thread will not have access to the session object (because
the Session object only lives the life of the page). if you are using the
inproc session manager, you could pass the object to the thread, and add it
to session.

-- bruce (sqlwork.com)
"NIan" <we*******@gmail.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
recently I have to create a search engine that will pick up stuff form
different external source. they will be divided into sections(tabs). My
idea is:
1. Multithread (Default Tab content with Highest Priority, rest with
low)
2. Once the default tab is done it will render the page
2. On the background:It will get the rest of the data and put into
session variable
3. When user click on different section (PostBack). it will check the
SESSION variable if the data is ready.
4. If it does ... perform the databinding process.

my problem is after the page is being render and display to the client.
and from debug mode it went though the process of adding to data to the
SESSION variable. but when User click on different section the SESSION
variable remain the same.

Nov 19 '05 #2
by default asp.net uses inproc session manager, so that's good to go
but pass the object to the thread, can you explain? because I'm still
in ASP.NET 1.1 can't pass any paramete
if (!Page.IsPostBack)
{
ThreadStart TS = new ThreadStart(RunThreadA);
Thread ThreadA = new Thread(TS);
ThreadA.Name="ThreadA";
ThreadA.IsBackground = true;
ThreadA.Start();
ThreadStart TZ = new ThreadStart(RunThreadB);
Thread ThreadB = new Thread(TZ);
ThreadB.Start();
ThreadB.Join();
}

public void RunThreadA()
{
......Business logic....
lock(Session.SyncRoot)
{
Session["FinishedThreadA"] = true;
}
}

Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Stanimir Stamenkov | last post by:
Here are two cases regarding inline-level elements' line-height, padding and background, which I doesn't understand: <div style="background: black; color: white; line-height: 1.5">...
0
by: Gomaw Beoyr | last post by:
Hello The book "C# Black Book" chapter about Threads says that a "background thread" cannot communicate directly with a visual element, e.g. a label, and thus has to use the BeginInvoke method,...
11
by: PJ | last post by:
I'd like to create a subsystem in my asp.net application that is responsible for emails that need to be send out based upon certain events so that the main request/response threads aren't...
2
by: Paul Hatcher | last post by:
I have an ASP.NET application that uses a background threads to perform a long-running process. What I'm not sure is how to track and communicate with the thread. The site is divided up into...
0
by: JC Voon | last post by:
Hi All: I'm new in Threading and Web Services, can someone please verify my code, i'm not sure whether this is the correct way, althought it is partially work, but some time it will raise...
11
by: Steve Kirkendall | last post by:
I need a work-around for an IE limitation, regarding fetching HTTP documents in the background. It takes a bit of explaining; please be patient... I'm working on an project that will run on an...
2
by: Ken Cox - Microsoft MVP | last post by:
I'm trying to find a way to program in ASP.NET 2.0 but capture the HTML output. I found the following routine in ASP.NET 2.0 Cookbook from O'Reilly. It doesn't work if I include a server-side...
1
by: ngpost1 | last post by:
I have a Crystal Reports.Net report being generated from my C# application. I would like to change the background color of the details section (not the text mind you) of the report on certain...
8
by: =?Utf-8?B?R3JlZyBMYXJzZW4=?= | last post by:
I'm trying to figure out how to modify a panel (panel1) from a backgroundworker thread. But can't get the panel to show the new controls added by the backgroundwork task. Here is my code. In...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.