我在下面的剃须刀页面上有链接。Razor actionlink autogenerating?length = 7 in URL?
@Html.ActionLink("Create New Profile", "Create", "Profile", new { @class="toplink" })
我看到的是低于
<a href="/admin/profile/create?length=7" class="toplink">Create New Profile</a>
当我点击链接页面查看源代码。网址如下所示。
http://localhost:54876/admin/profile/create?length=7
我不想要?长度= 7。为什么这是自动生成的。
它必须与您的路线有关。默认情况下,`ActionLink`应该生成`/ Profile/Create`的href。其中`Profile`是控制器参数,`Create`是动作方法参数。 `/ admin`被放入href的事实突出了这个问题。你能展示你的路线吗? – RPM1984 2010-12-05 07:43:23