Url.Action() uses routing to create the URL. therefore, if you want to change it, you must change it. He currently says that the default controller is Home , and the default action is Index . Change them to something else and then it will give you a different URL.
For example, your route configuration is probably something like this:
routes.MapRoute( name: "Default", url: "{controller}/{action}/{id}", defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } );
Change the default values ββto something else or delete them:
routes.MapRoute( name: "Default", url: "{controller}/{action}/{id}", defaults: new { id = UrlParameter.Optional } );
Please note that this means that your pages will only be accessible through the full controller/action paths, so you might want to create a landing page and do this by default.
If you absolutely need to know the full action URL, you can do it this way. first create an additional route and place it at the bottom of the route configuration. This will never be used by the system by default:
routes.MapRoute( name: "AbsoluteRoute", url: "{controller}/{action}/{id}", defaults: new { id = UrlParameter.Optional } );
Then in the code you can call this (not sure if it is available in Razor, but it should be easy to write a helper method):
var fullURL = UrlHelper.GenerateUrl("AbsoluteRoute", "Index", "Home", null, null, null, null, System.Web.Routing.RouteTable.Routes, Request.RequestContext, false);