asp.net-mvc – ASP.NET MVC Intellisense没有找到ViewData
发布时间:2020-05-27 15:21:54 所属栏目:asp.Net 来源:互联网
导读:我试图在asp.net上浏览 following tutorial.当我开始使用这段代码时: %@ Page Language=C# MasterPageFile=~/Views/Shared/Site.Master AutoEventWireup=true CodeBehind=Index.aspx.cs Inherits=MvcApplication1.Views.Home
|
我试图在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将不起作用.(编辑:安卓应用网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- asp.net-mvc – redirectToAction()和View()之间的区别
- asp.net – 如何在web.config的MailSetting部分设置友好的电
- asp.net-mvc – asp.net mvc HttpPostedFileBase获取文件扩
- asp.net – 在PostBack期间Recaptcha消失
- asp.net – 需要有关选择数据访问方法的建议
- asp.net – default.aspx中的“StartTag:invalid element
- asp.net-mvc-4 – 如何在iframe src中使用Url.Action
- asp.net – 跨应用程序的表单身份验证
- ASP.Net 分页控件源码
- ASP.NET MVC删除操作链接确认
推荐文章
站长推荐
- 复合视图模型对象导致远程验证失败
- asp.net-mvc – 返回ASP.Net Core MVC中的上一页
- asp.net – Elmah vs Elmah.MVC Nuget软件包 –
- ASP.NET MVC ViewEngine ViewLocationCache.GetV
- asp.net文件上传功能(单文件,多文件,自定义生成
- asp.net/C#中的请求来源
- asp.net – Fulltext Query String的全文查询参数
- asp.net-mvc – 范围注释在无和100之间?
- asp.net – SignalR在.NET客户端和服务器之间的安
- asp.net-mvc – Razor中()(括号)和{}(大括号)之间
热点阅读
