I'm working on one application which is using ASP.Net with C# in which I have one method with two parameters and I want to start it using Thread
, to keep track either method execution is completed or not.
scenario:
Below is the method which I want to call in thread:
private long CreateAJobCopy(long jobID, long userID)
{
JobManagementClient jobManagementClient = new JobManagementClient();
long newJobID=0;
try
{
JobResultEntity jobResultEntity = jobManagementClient.CreateJobCopy(Common.AuthenticationToken, jobID, userID);
if (jobResultEntity.Job != null)
newJobID = jobResultEntity.Job.JobID;
return newJobID;
}
catch (Exception ex)
{
ExceptionLogger.LogException(ex, Common.AuthenticationToken);
return 0;
}
}
I want to display message to User that job is being created:
lblCreateJobCopyMessage.Text = "Please wait while new job is being created!";
when the method execution is completed I want to redirect to new page.