0

With reference to .net mvc redirect to external url.

So you have your controller setup with the redirect as below:

public ActionResult SiteDetails(short id)
{
   return Redirect("localhost:1234/Controller/Action");
}

BUT
- nothing happens when you call the action.
- Expecting a redirect and nothing happens.
- Expecting a redirect to another MVC site and nothing happens.
- Not only that - in debug the string url going into the redirect works when copied into the browser.

Why doesn't this work?

Community
  • 1
  • 1
Simon Legg
  • 889
  • 1
  • 8
  • 11

1 Answers1

2

Requires 'http://' within the string.

public ActionResult SiteDetails(short id)
{
   return Redirect("http://localhost:1234/Controller/Action");
}
Simon Legg
  • 889
  • 1
  • 8
  • 11