How to Remove Url Parameter name using Routing in MVC?

How to Remove Url Parameter name using Routing in MVC?, someone asked me to explain?

In this Article, Describe how to Remove UrlParameter using MVC Routing in mvc. If you new to Routing in mvc please refer to this link for more details 

Here I explain with small demonstration to achieve this. I have passed two parameter with name of value and id in my url. I want to remove last two passing parameter name value and id. 

For example let you assume this is my url link



     Step -I


        //Modify your Routeconfig.cs like this




           new { controller = "User",action = "Index", value= UrlParameter.Optional, id =UrlParameter.Optional }





   //User Controller

           public ActionResult Index(string value,int id)


             // write Your logic here

        return view();





   //Create an Index view for UserController             

         @Html.ActionLink("LinkName", "Index","User", new {value = "98998", id = "2"},null)




 Likewise we can remove multiple parameter name from the url.

Post your comments / questions