Home > DeveloperSection > Forums > MVC routing the index page
Allen Scott

Total Post:46

Posted on    May-19-2015 4:13 AM

 ASP.NET MVC Routing 

 1 Reply(s)
 785  View(s)
Rate this:

I have very simple mvc application

When I type  http://localhost:8080

The following route in the routeconfig takes me to the Home controller


                    name: "Default",

                url: "{controller}/{action}/{id}",

                defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }


When I type the following, get 404 error.


I want to map this request to Home Controller's Get Action with name function (see below). How do I go about doing that?

public Person Get(string name)


        PersonRespository db = new PersonRespository();

        return db.GetPerson(name);


Kamlakar Singh
Kamlakar Singh

Total Post:194

Posted on    May-19-2015 6:12 AM

    Try this following:


            name: "Custom",

            url: "{name}",

            defaults: new


                    controller = "Home",

                    action = "Get"


Don't want to miss updates? Please click the below button!

Follow MindStick