C# 编译器在视图-Asp Net MVC 4应用程序中找不到@model MembershipUserCollection
为什么我不能使用C# 编译器在视图-Asp Net MVC 4应用程序中找不到@model MembershipUserCollection,c#,.net,asp.net-mvc,razor,asp.net-mvc-4,C#,.net,Asp.net Mvc,Razor,Asp.net Mvc 4,为什么我不能使用 @model MembershipUserCollection 也不是 在我看来 编译器抱怨说找不到MembershipUserCollection。您缺少使用语句的 @using System.Web.Security @model MembershipUserCollection your html code 您缺少使用语句的 @using System.Web.Security @model MembershipUserCollection your html c
@model MembershipUserCollection
也不是
在我看来
编译器抱怨说找不到
MembershipUserCollection
。您缺少使用语句的
@using System.Web.Security
@model MembershipUserCollection
your html code
您缺少使用
语句的
@using System.Web.Security
@model MembershipUserCollection
your html code
您的项目中是否引用了System.Web.ApplicationServices
?我无法重现您的错误。检查是否有对System.Web.ApplicationServices.dll的引用,并检查目标框架设置(是否使用.NET 4?)。@Michael Perrenoud是的,引用在那里。这只在视图中发生。我能够在controller@Davide伊卡迪。Net 4.0。编译器是否指出任何其他错误?您的项目中是否引用了System.Web.ApplicationServices
?我无法重现您的错误。检查是否有对System.Web.ApplicationServices.dll的引用,并检查目标框架设置(是否使用.NET 4?)。@Michael Perrenoud是的,引用在那里。这只在视图中发生。我能够在controller@Davide伊卡迪。Net 4.0。编译器是否指出任何其他错误?这不是问题所在,因为@model System.Web.Security.MembershipUserCollection
也不起作用。是。。你是对的。请参见此处的问题:。目前,我必须使用ViewBag传递集合,但我希望避免这一问题,因为@model System.Web.Security.membership usercollection
也不起作用。是的。。你是对的。请参见此处的问题:。目前,我必须使用ViewBag来通过收集,但我想避免这种情况