主キーの int ID myidをfor each ループを使用する.tolistメソッドに渡す方法を知りたいと思っていました
見る
@foreach (var item in Model)
{
@Html.ActionLink("View", "detail", new { id = item.myid})
@Html.ActionLink("Add Pictures", "pictures")
}
.tolist コントローラー
[Authorize]
public ActionResult mylist(list listings)
{
var showlist = (from s in db.list where getid == s.RegistrationID select s).ToList();
return View(showlist.ToList());
}
上記からわかるように、 mylistに[authorize]表記があります。これは、foreach ステートメントがオンになっているため、人々は既にログオンしています。私の質問は、int myidを@Html.ActionLink("Add Pictures", "pictures")に入れることはできますか?? ユーザーは簡単に別の番号を入れて、他の人の写真を見ることができるので、私はそれをブラウザに入れたくありません。