我的主页上:Asp.Net MVC ActionLink的具体HREF
http://localhost/
http://localhost/Home (yeah, this one too, though I don't like it)
我有一个foreach循环,通过我的类别循环。我想Html.ActionLink指向:
http://localhost/site/{category-name}
我目前有:
Html.ActionLink(cat.cat_name, "site", "", new { id = cat.cat_name}, null)
这指向:
http://localhost/Home/site/{cat_name}
我想摆脱家庭的。
编辑
不管我是什么页面上,我希望链接指向:
http://localhost/site/{category-name}
不知道我按照100%的问题,但它看起来像你使用的默认路线和家庭控制器?如果是这种情况,那么你会想改变你的路线和/或你正在使用的控制器。 – YetAnotherDeveloper 2009-08-07 01:05:02
@YetAnotherDeveloper - 将此作为答案发布,因为查看路线指向了正确的方向。谢谢! – Martin 2009-08-07 01:16:37