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
Saravanan Ponnusamy
363
4.5k
1.1m
how to do Response.Redirect inside task
Jun 29 2018 8:03 PM
here is my code..
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('Inside Catch.');</script>"); // not firing
Response.Redirect("Home.aspx", false);// raising error or not firing
}
}, token);
So, here is my question is...
once the loop is finish inside the task im 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 achive 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 dont want that.. i need to show real javascript alert and redirect the page ....
pls dont give any web reference.. give some code...
thanks all..
Reply
Answers (
2
)
How to create a database seeder?
Pass model through RedirectToAction