It looks like you are missing the controller in your route values (I noticed you are not specifying one anywhere in your @Html.ActionLink
)
@Html.ActionLink("edit", "Edit", new { controller="CourseCategory", id = item.Id }, new { @class = "btn btn-default btn-xs" })
Or - an alternative overload of the Html.ActionLink
@Html.ActionLink("edit", "Edit", "CourseCategory", new { id = item.Id }, new { @class = "btn btn-default btn-xs" })
Lastly, it never hurts to include the area name as part of the RouteValues dictionary, but this is not required.
EDIT
It looks like you updated your question with some additional information. This does not look right (having a blank value for URL)
routes.MapRoute(
name: "HomePage",
url: "",
defaults: new { controller = "Home", action = "Index" }
);
By default, it should look something like this
routes.MapRoute(
name: "HomePage",
url: "{controller}/{action}",
defaults: new { controller = "Home", action = "Index" }
);
I would assume having a blank URL is definitely something that could cause a blank URL to be created in an Html.ActionLink
. These helpers looks at your route config to generate the URL and this one seems to be taking over probably everything since it matches everything.