Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 编译器在视图-Asp Net MVC 4应用程序中找不到@model MembershipUserCollection_C#_.net_Asp.net Mvc_Razor_Asp.net Mvc 4 - Fatal编程技术网

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来通过收集,但我想避免这种情况