Click here to Skip to main content
15,884,388 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
Before
C#
routes.MapRoute(
          name: "Default",
          url: "{controller}/{action}/{id}",
          defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
      );



After
C#
routes.MapRoute(
               "Default",
               "{action}/{id}",
               defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional });


What I have tried:

Anchor tag not show..Only Plain text showing there when i Use @Url.Action Or @Html.ActionLink
Posted
Comments
F-ES Sitecore 16-May-16 4:50am    
I don't think that's a valid route, how is it going to know which controller to use? You're specifiying a default controller but your url path doesn't contain a {controller} token so it doesn't know where in the url it goes.
santosh.yadav198613 16-May-16 10:01am    
Without controller it will not work, another way is you can use Attribute Routing.
J$ 16-May-16 13:20pm    
You probably have to use different overrides of @Html.ActionLink or @Url.Action since you no longer want to provide the controller name as an argument.

Can you post the actual code you're using to generate the action links?
Mahesh@Dev 25-May-16 0:42am    
Any Other solution for my url route

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900