I am new to writing multi-threaded apps in asp.net. I have a main class that It suppose to send bulk email which take a long time. So, I use a thread in main method to show a template page to user which shows your emails will be send and then it return to main method and continue to send these email. in main method :
ThreadStart job = new ThreadStart(showresult);
Thread thread = new Thread(job);
thread.Start();
SENDEMAILMETHOD();
and in showresult method :
public void showresult ()
{
try{
string showresulttemplate = File.ReadAllText (Path.GetFullPath (Server.MapPath ("~/templates/messaging/showresult.tpl")));
DotLiquid.Template liquidresultshow = Template.Parse (showresulttemplate);
Response.Write (liquidresultshow.Render ());
} catch (Exception ex ) {
Logger.Error ( ex.ToString () );
}
}
what's wrong with my code or logic?