我在下面的剃鬚刀頁面上有鏈接。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