简体   繁体   中英

Error with Html.RouteLink in ASP.NET MVC RC

I was using Html.RouteLink("LINKTEXT","RouteName",new RouteValueDictionary()) in asp.net MVC beta without problem, today I upgrade to ASP.NET MVC RC and this does no create the link anymore. The route still works because I type in the browser and I go to the Page I want. Any help?

It's bug in RC. Workaround for now is to put your controller and action names in RouteLink.

For example:

<%= Html.RouteLink(cat.Name, "Category", new { id = cat.id, controller = "Home", action = "Category" })%>

I also found one more issue with publishing web to shared hosting (mine is on iis6): "specific version" property of system.web.mvc reference in project has to be set to "false". Before it was "true" and I had one error in web.config regarding registration of sys.web.mvc assembly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM