YanoRyuichi.com/
Wiki
Blog
GitHub
Sandbox
開始行:
* Razor - ドロップダウンリスト [#x6544369]
** Cotroller [#wa52bc55]
var teamList = _teamService.GetTeamList().ToList(); ...
teamList.Insert(0, new teamEntity()); ...
playerVm.TeamList = new SelectList(teamList, "team_id", ...
** ViewModel [#l88e4305]
public class PlayerViewModel
{
public IEnumerable<SelectListItem> TeamList { get; s...
}
** View [#f6e1d989]
@using (Html.BeginForm("PlayerEdit", "Home", null, FormM...
{
@Html.HiddenFor(x => x.Player_id)
<table>
<tr>
<th>@Html.LabelFor(x => x.Team_id)</th>
<td>@Html.DropDownListFor(x => x.Team_id, Mo...
</tr>
</table>
<div><input type="submit" value="OK" /></div>
}
** multiple [#e8c70d0a]
http://stackoverflow.com/questions/7839760/how-can-i-crea...
** 参考 [#b98cac62]
: @IT ASP.NET MVC入門 | http://www.atmarkit.co.jp/fdotnet...
: MSDN | http://msdn.microsoft.com/ja-jp/library/dd410596...
: 「ドロップダウンリストを表示する時、Controller側でSelec...
終了行:
* Razor - ドロップダウンリスト [#x6544369]
** Cotroller [#wa52bc55]
var teamList = _teamService.GetTeamList().ToList(); ...
teamList.Insert(0, new teamEntity()); ...
playerVm.TeamList = new SelectList(teamList, "team_id", ...
** ViewModel [#l88e4305]
public class PlayerViewModel
{
public IEnumerable<SelectListItem> TeamList { get; s...
}
** View [#f6e1d989]
@using (Html.BeginForm("PlayerEdit", "Home", null, FormM...
{
@Html.HiddenFor(x => x.Player_id)
<table>
<tr>
<th>@Html.LabelFor(x => x.Team_id)</th>
<td>@Html.DropDownListFor(x => x.Team_id, Mo...
</tr>
</table>
<div><input type="submit" value="OK" /></div>
}
** multiple [#e8c70d0a]
http://stackoverflow.com/questions/7839760/how-can-i-crea...
** 参考 [#b98cac62]
: @IT ASP.NET MVC入門 | http://www.atmarkit.co.jp/fdotnet...
: MSDN | http://msdn.microsoft.com/ja-jp/library/dd410596...
: 「ドロップダウンリストを表示する時、Controller側でSelec...
ページ名: