I'm experiencing Asp.net MVC5. and I did the following.
Model Name is Movie, with the code as below,
namespace mvc1.Models
{
public class Movie
{
public int Id { get; set; }
public string Name { get; set; }
}
And a Controller with name 'MoviesConroller'. and a using statement "using mvc1.Models".
public ActionResult Random()
{
var movie = new Movie() { Name = "Star Trek!" };
return View();
}
And a View with name Random
@model mvc1.Models.Movie
@{
ViewBag.Title = "Random";
Layout = "~/Views/Shared/_Layout.cshtml";
}
<h2>@Model.Name</h2>
and this is the error I get this Error