Here is my code.
protected void Send(object sender, ImageClickEventArgs e)
{
try
{
ObjCancellationTokenSource = new CancellationTokenSource();
CancellationToken token = ObjCancellationTokenSource.Token;
var ObjTask = Task<string>.Factory.StartNew(() =>
{
while (!token.IsCancellationRequested)
{
for(i=0;i<n;i++)
{
----------some operation------
}
Response.Write("<script>alert('Completed.');</script>"); // not firing
Response.Redirect("Home.aspx", false);// raising error or not firing
}
}, token);
catch (Exception ex)
{
}
}
So, here is my question is...
once the loop is finished inside the task I'm trying to show alert through Response.Write and after I need to redirect my page to another page through Response.Redirect...
but both or not working...
how can I achieve it??
if I do both Response.Redirect and Response.Write without using task operation.. its working fine.
I googled this .. but in all sites, all are using Console.Write method to show some alert. I don't want that.. I need to show real javascript alert and redirect the page ....
pls don't give any web reference.. give some code...
thanks all.