Is there a way to rewrite the path displaying a different view instead of RedirectToAction or Redirect? I don't want the url to change, but notice the regular RewritePath cannot be "returned", so the action actually keeps going after it!
public ActionResult Register(){
if (somehting){
HttpContext.RewritePath(url);
// I want it to stop here, somehow, but it keeps going and expects a return statement
}
return View();
}
Update: I just noticed when I use the one circulating in stackoverflow (with ProcessRequest) if I run F5 it works, but when I access directly it gives me the "'HttpContext.SetSessionStateBehavior' can only be invoked before 'HttpApplication.AcquireRequestState' event is raised." which means im missing something in IIS setup, what is it? :s
[Update] To be clear on this, I need to rewrite a "url" not an action or view name, it must be a url, like good old RewritePath(url)