If you're trying to route to a specific controller and action without having them in the URL, you need to specify them as defaults. Your route for this would be something like this:
routes.MapRoute(
name: "Profile",
url: "{id}"
defaults: new { controller = "Profile", action = "Show" }
);
This would give you a route that would map "http://www.mysite.com/user123" to the Show
action on the ProfileController
, passing user123
as the ID parameter.
public class ProfileController : Controller
{
public ActionResult Show(string id)
{
...
}
}