TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Fiona
NA
8
0
Thread.Start not running anything?
Jun 12 2006 10:43 AM
Hi,
I'm new to threading and would appreciate a little help. Have looked around for answers to my problem, but can't find anything, even thought I'm sure it's easy!
I have a process in my ASP.NET app which takes a long time to complete (basically it creates a monster PDF file). What I would like to happen is for user to be able to click the button to create this file and then continue with their site experience while the file is generated in the background.
I thought threading might be the solution to this, so have come up with the following:
public
void
archiveSite()
{
ThreadStart threadFunc =
new
ThreadStart (threadedArchiveSite);
Thread fThread =
new
Thread (threadFunc);
fThread.Start ();
HttpContext.Current.Response.Write(fThread.IsAlive.ToString()); // this dumps "True"
}
public
void
threadedArchiveSite()
{
//do all the gubbins to create my PDF
}
Now, as much as calling archiveSite() now doesn't make the browser sit there like a lemon for five minutes, unfortunately the PDF isn't created.
There's no error in the code, because if I put a direct call to threadedArchiveSite() inside archiveSite() it works fine.
I know I muct be missing something here.
Any hints?
Thanks :D
Reply
Answers (
0
)
project output not found
view as website after installing the project in the server