asp.net-mvc – ASP.NET MVC Intellisense没有找到ViewData
发布时间:2020-12-15 19:54:04 所属栏目:asp.Net 来源:网络整理
导读:我试图在asp.net上浏览 following tutorial.当我开始使用这段代码时: %@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" AutoEventWireup="true" CodeBehind="Index.aspx.cs" Inherits="MvcApplication1.Views.Home.Index" % %@ Import N
我试图在asp.net上浏览
following tutorial.当我开始使用这段代码时:
<%@ 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> 当我输入ViewData时,它不会在intellisense中显示,就好像我没有包含引用或其他东西.另外下来Html.Encode Html没有在intellisense中显示.我究竟做错了什么? 我正在使用最新版本的MVC. 解决方法
尝试在MVC项目上进行构建.在第一次编译后面的代码之前,intellisense将不起作用.
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- 解决“这个操作需要IIS集成管道模式”在ASP.net MVC2
- asp.net – 在更改密码时从所有浏览器注销用户
- asp.net – 如何使用ReportService2010命名空间呈现报告
- asp.net – 使用GhostScript将PDF转换为服务器上的图像集合
- ASP.NET MVC 1是否与ASP.NET MVC 2兼容?
- asp.net – 图像文件正由另一个进程使用
- Asp.Net Session相关配置
- 如何使用ASP.NET Core自定义Tag Helper中的视图?
- asp.net-mvc – ViewModel应该位于ASP.NET MVC应用程序的目
- asp.net-mvc – 如何使用ASP.NET MVC 1.0从文件系统直接提供
推荐文章
站长推荐
热点阅读