How to redirect to action of another controller of an referenced project

4.9k views Asked by At

Hi i have a created an another project inside my application. Now i want to move to the action of the Controller in the new project from the action in my old project.

I tried many things like:

return RedirectToAction("ActivityPosting", new RouteValueDictionary(new { controller = "ActivityPosting", action = "ActivityPosting" })); 

Then...

return RedirectToAction("ActivityPosting", "ActivityPosting")

But with this it moves to the action but does not show up the View.
I think the problem may be with the port number.

the older project has port number:http://localhost:18520
and the new project has port number:http://localhost:52146
But i dont know how to redirect to a new Port. Please help me with this.

1

There are 1 answers

1
Darin Dimitrov On BEST ANSWER

The RedirectToAction method is intended to be used to perform redirects only within the same project. If you want to redirect to another application you should use an absolute url and the Redirect method:

return Redirect("http://example.com/foo/bar");