検索が見つかりませんでした。 nullであると私はヌルがなぜ来るが、ここはおそらくヌル'System.NullReferenceException'がApp_Web_zqz5irkc.dllで発生しましたが、ユーザーコードで処理されませんでした
@model Vidly.Models.Movie
@{
ViewBag.Title = "Random";
}
<h2>
@Model.Name
</h2>
があるランダム表示を実行したときに、それ
に修正する方法をどこ
カント見つけます。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Vidly.Models;
namespace Vidly.Controllers
{
public class MovieController : Controller
{
// GET: Movie
public ActionResult Random()
{
var movie = new Movie() { Name = "Shrek!" };
return View();
}
}
}
これは私が、私はあなたがビューにモデルオブジェクトを渡す必要があります良い
モデルをビューに渡します。 'ビューを返す(ムービー);' –