我正在尝试浏览asp.net上的以下教程.当我开始使用这段代码时:
<%@ 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>
Run Code Online (Sandbox Code Playgroud)
当我输入ViewData时,它不会在intellisense中显示,就好像我没有包含引用或其他东西.另外下来Html.Encode Html没有在intellisense中显示.我究竟做错了什么?
我正在使用最新版本的MVC.