I have a non-controller file called MyLib.cs where I have a method where, for a given condition, I want it to redirect to another page.
I used RedirectToAction()
, but I got an error saying it dose not exist in current context.
Any ideas what I should use?
I think you can use Response.Redirect here. Consider this code:
HttpContext.Current.Response.Redirect("YOUR_PAGE_Virtual_PATH");
//example: http://www.mywebsite.com/home/list