I've to redirect to the controller action method from non-controller class.
I am using HttpContext.Current.Response.Redirect();
, it is redirecting me to my action method, but it's throwing an error
"Cannot redirect after HTTP headers have been sent".
public void MethodName ()
{
HttpContext.Current.Response.Redirect(url);
}
I want to redirect form non-controller class void method.