protected System.Threading.Thread m_searchthread = null;
Question: I've implemented a search algorithm, which a user can start from an ASP.NET website.
When the user clicks on Button "Start", this code is executed:
m_searchthread = new System.Threading.Thread(new System.Threading.ThreadStart(Search));
m_searchthread.IsBackground = true;
m_searchthread.Start();
Now I want to make it possible to abort the search thread. So the user presses on Button "Abort", and this code is executed:
m_searchthread.Abort();
My problem now is: the postback of the abort button resets m_searchthread to NULL...
I am aware of the fact that the thread should be aborted using a flag. The core problem is just: how to stop a thread when you loose all the variables ?