c# - Asp.NET Mvc 4 Routing -


i'm making blog in mvc 4 , trying make route .

here how looks now:

/about/index 

but i'd like:

/about/firstname-lastname 

the firstname , lastname same; it's not supposed dynamic. here have far. know because needs know view show. there way if /about/firstname-lastname show index?

routes.maproute(             name: "about",             url: "{controller}/{name}/",             defaults:                 new                     {                         controler = "about",                         action =  urlparameter.optional,                         name = "firstname-lastname"                      }             ); 

this should trick

routes.maproute(     name: "about",     url: "about/anne-refsgaard/",     defaults:         new             {                 controler = "about",                 action =  "index",             }     ); 

this route needs added before standard route


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -