【发布时间】:2019-06-01 13:35:50
【问题描述】:
我有这个 Razor 页面用户视图,其中包含一个表格中的学生列表
我想单击一行以打开一个 URL,并传递所选学生行的 ID。这是我到目前为止得到的结果
@foreach (var student in Model._User.Students)
{
<tr onclick="location.href = '@(Url.Action("Info", new { id = student.Id }))'">
<td>Some basic info of student</td>
</tr>
}
我希望被重定向到 /Info/{id} 但得到 /Useview/{id}?action=Info
【问题讨论】:
标签: asp.net asp.net-core razor