I am trying to go through the following tutorial on asp.net. When I get down to this code:
<%@ Page Language='C#' MasterPageFile='~/Views/Shared/Site.Master' AutoEventWireup='true' CodeBehind='Index.aspx.cs' Inherits='MvcApplication1.Views.Home.Index' %> <%@ Import Namespace='MvcApplication1.Models' %> <asp:Content ID='indexContent' ContentPlaceHolderID='MainContent' runat='server'> <table> <tr> <th>Id</th> <th>Title</th> <th>Release Date</th> </tr> <% foreach (Movie m in (IEnumerable)ViewData.Model) { %> <tr> <td><%= m.Id %></td> <td><%= Html.Encode(m.Title) %></td> <td><%= m.DateReleased %></td> </tr> <% } %> </table> </asp:Content>
When I type in ViewData it doesn’t show in intellisense as if I am not including a reference or something. Also further down Html.Encode Html doesn’t show in intellisense. What am I doing wrong?
I am using the latest version of MVC.
Try doing a Build on your MVC project. Until the code behind has been compiled for the first time the intellisense won’t work.