简体   繁体   English

ASP.NET MVC RC中的Html.RouteLink错误

[英]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. 我在asp.net MVC beta中使用Html.RouteLink(“ LINKTEXT”,“ RouteName”,新RouteValueDictionary())没问题,今天我升级到ASP.NET MVC RC,这不再创建链接。 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. 这是RC中的错误。 Workaround for now is to put your controller and action names in RouteLink. 现在的解决方法是将您的控制器和动作名称放入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". 我还发现了将Web发布到共享主机的另一个问题(我的网站在iis6上):项目中system.web.mvc引用的“特定版本”属性必须设置为“ false”。 Before it was "true" and I had one error in web.config regarding registration of sys.web.mvc assembly. 在“ true”之前,我在web.config中遇到一个有关sys.web.mvc程序集注册的错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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