3

I would like to just set default action to call when use visit the site

Example:

When he type www.abc.com

He should view www.abc.com/somecontroller/someaction

But the path should not be shown which is /somecontroller/someaction

Please help me I have tried this

   routes.MapRoute(
            name: "Default",
            url: "{controller}/{action}/{id}",
            defaults: new { action = "Index", id = UrlParameter.Optional }
        );

But this also shows the complete path. Thankyou.

TAHA SULTAN TEMURI
  • 4,031
  • 2
  • 40
  • 66
  • In `Begin_Request`, check if the URL has no controller and action, then you can redirect to `someController/someAction`. Now consider that user clicks on `Home` button or clicks on site logo that redirects to home page, your url would be like `abc.com/home`. – DhavalR Jan 17 '18 at 06:46

0 Answers0