1

私はRazorフォームを持っています

using (Html.BeginForm("TermList", "Course", FormMethod.Get))
{

    <div style="text-align:right;display:inline-block; width:48%; margin-right:25px;">
             @Html.DropDownList( "id", (SelectList) ViewBag.schoolId)
    </div>
    <input type="submit" value="Choose school" />
}

このフォームが次の URI に投稿されることを期待していました。

http://localhost:56939/Course/TermList/764

代わりに、ルートは次のようになります。

http://localhost:56939/Course/TermList?id=764

ルートは使用されていません。パラメータを廃止したい

?id=764
4

1 に答える 1