asp.net mvc 3 - RouteLink empty Href -
im using mvc3 razor view engine. want use route href
the following route registration, (the route seems work can use browser directly use it)
routes.maproute( "additem", "{listareaname}/{listslug}/add", new { controller = "list", action = "additem" } );
but @html.routelink not work. returns empty href link
here of attempts
@html.routelink("add new item", "additem", new { controller="list", action="additem", listareaname = model.listareaname, listslug = model.slug })<br /> @html.routelink("add new item1", "additem", new { controller = "list", listareaname = model.listareaname, listslug = model.slug })<br /> @html.routelink("add new item2", "additem", new { action = "additem", listareaname = model.listareaname, listslug = model.slug })<br /> @html.routelink("add new item3", "additem", new { controller = "list", action = "additem", listareaname = model.listareaname, listslug = model.slug })<br /> @html.routelink("add new item4", "additem", new { controller = "list", action = "additem", listareaname = model.listareaname, listslug = model.slug })<br /> @html.routelink("add new item5", "additem", new { listareaname = model.listareaname, listslug = model.slug })<br /> @html.routelink("add new item6", "additem", new { controller = "listcontroller", action = "additem", listareaname = model.listareaname, listslug = model.slug })<br />
if miss out route name, generates working link, no in right format
most of material found preview release of v1. has issue sorted?
any idea's?
in last route link have mistake, should not use controller
suffix:
@html.routelink( "add new item6", "additem", new { controller = "list", action = "additem", listareaname = model.listareaname, listslug = model.slug } )
as far others concerned generate following url: /listareaname/slug/add
in asp.net mvc 3 rtm assuming have default routes setup , have added route shown in question.
Comments
Post a Comment