C# MVC4错误CS1061:&x27;对象';不包含';姓';
在远程服务器上运行时,出现以下错误。在本地IIS上,它工作正常C# MVC4错误CS1061:&x27;对象';不包含';姓';,c#,asp.net-mvc-4,C#,Asp.net Mvc 4,在远程服务器上运行时,出现以下错误。在本地IIS上,它工作正常 <%@ Control Language="C#"Inherits="System.Web.Mvc.ViewUserControl<USB_ED.Models.ApplicationF orm>" %> <fieldset> <legend class="hideLegend"></legend>
错误CS1061:“对象”不包含“姓氏”的定义,并且找不到接受“对象”类型的第一个参数的扩展方法“姓氏” 模型-(在单独的项目中) 控制器<%@ Control Language="C#"Inherits="System.Web.Mvc.ViewUserControl<USB_ED.Models.ApplicationF orm>" %> <fieldset> <legend class="hideLegend"></legend> <label for="course"><strong>Select Course</strong></label> <select id="course"></select> </fieldset> <fieldset id="personalInformation"> <legend>Personal Information</legend> <div class="studentDetails fieldRow inline"> <table> <colgroup> <col style="width:auto"/> <col style="width:180px"/> <col style="width:auto" /> </colgroup> <tr> <td><%: Html.LabelFor(m => m.Surname) %></td> <td><%: Html.TextBoxFor(m => m.Surname) %></td> <td colspan="2"><%: Html.ValidationMessageFor(m => m.Surname) %></td> </tr>
看法public ActionResult Index() { var applicationForm = new ApplicationForm(); ApplicationFormInfo.LoadInfoMembers(); return View(applicationForm); }
Web.Config选择课程 个人信息 m、 姓氏)%> m、 姓氏)%> m、 姓氏)%>
远程服务器和本地计算机安装了MVC4和Dot Net Framework 4.5。
我的模型在一个单独的项目中。我怀疑问题出在远程IIS或web.config文件中。你能帮忙吗?我想你认为你有一个指令@模型与剃须刀配合使用。我使用的是ASPX表单,它包含以下内容:该应用程序安装在运行IIS 7.5的Server 2008 R2计算机上@model
<%@ Control Language="C#"Inherits="System.Web.Mvc.ViewUserControl<USB_ED.Models.ApplicationF orm>" %> <fieldset> <legend class="hideLegend"></legend> <label for="course"><strong>Select Course</strong></label> <select id="course"></select> </fieldset> <fieldset id="personalInformation"> <legend>Personal Information</legend> <div class="studentDetails fieldRow inline"> <table> <colgroup> <col style="width:auto"/> <col style="width:180px"/> <col style="width:auto" /> </colgroup> <tr> <td><%: Html.LabelFor(m => m.Surname) %></td> <td><%: Html.TextBoxFor(m => m.Surname) %></td> <td colspan="2"><%: Html.ValidationMessageFor(m => m.Surname) %></td> </tr>
<?xml version="1.0" encoding="utf-8"?> <!-- For more information on how to configure your ASP.NET application, please visit http://go.microsoft.com/fwlink/?LinkId=169433 --> <configuration> <appSettings> <add key="webpages:Version" value="2.0.0.0" /> <add key="webpages:Enabled" value="false" /> <add key="PreserveLoginUrl" value="true" /> <add key="ClientValidationEnabled" value="true" /> <add key="UnobtrusiveJavaScriptEnabled" value="true" /> </appSettings> <system.web> <httpRuntime targetFramework="4.5" /> <compilation debug="true" targetFramework="4.5" /> <pages> <namespaces> <add namespace="System.Web.Helpers" /> <add namespace="System.Web.Mvc" /> <add namespace="System.Web.Mvc.Ajax" /> <add namespace="System.Web.Mvc.Html" /> <add namespace="System.Web.Routing" /> <add namespace="System.Web.WebPages" /> </namespaces> </pages> </system.web> <system.webServer> <validation validateIntegratedModeConfiguration="false" /> <handlers> <remove name="ExtensionlessUrlHandler-Integrated-4.0" /> <remove name="OPTIONSVerbHandler" /> <remove name="TRACEVerbHandler" /> <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" /> </handlers> </system.webServer> <runtime> <!--<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" /> </dependentAssembly> </assemblyBinding>--> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" /> <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" /> <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" /> <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" /> </dependentAssembly> </assemblyBinding> </runtime> </configuration> </pre>