views:

130

answers:

2

The following examples are redirects wich we're trying. The first one, for user login, works, after that no redirect works. I have no idea about what may be the cause, tried redirecttoroute too, it is like if the server wasn't sending the headers or anything. I have no sniffing software to check this out.

UrlHelper uH = new UrlHelper(new RequestContext(this.HttpContext, this.RouteData), RouteTable.Routes);
Response.Redirect(uH.Action("TrabalheExperiencia", "Contact"), true);
return this.RedirectToAction("TrabalheExperiencia");
return RedirectToAction("TrabalheExperiencia");

Edit: All those lines were tried, and none worked. Even using in the FIRST line of the action, the redirect command works, but the redirect it self fails.

+1  A: 

Is the action on the same controller? If not, you need to specify the controller as well. Note that the last two are exactly the same; you're just explicitly using this on the penultimate one, whereas on the last one it is merely implied.

 return this.RedirectToAction( "TrabalheExperiencia", "Contact" );
tvanfosson
+1  A: 

Your question is not very clear. Normally you'd use the syntax in the last line to redirect from an action in MVC, which is the same as the third line. The first two lines should not be used - you should stick to ActionResults.

David M