asp.net-mvc – Ext.NET没有与ASP.NET MVC 4集成
发布时间:2020-12-16 06:22:43 所属栏目:asp.Net 来源:网络整理
导读:我在VS 2012中创建了一个MVC 4 Web应用程序. 通过NuGet下载Ext.Net 2. 在我的视图/ home / index.cshtml文件中,我试图输入: @Html.X().ResourceManager() 我跑的时候会得到以下信息: CS1061: ‘System.Web.Mvc.HtmlHelper’ does not contain a definition
我在VS 2012中创建了一个MVC 4 Web应用程序.
通过NuGet下载Ext.Net 2. 在我的视图/ home / index.cshtml文件中,我试图输入: @Html.X().ResourceManager() 我跑的时候会得到以下信息:
这是我的web.config <?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> <configSections> <section name="extnet" type="Ext.Net.GlobalConfig" requirePermission="false" /> </configSections> <connectionStrings> <add name="DefaultConnection" connectionString="Data Source=(LocalDb)v11.0;Initial Catalog=aspnet-MvcApplication3-20121016104640;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnet-MvcApplication3-20121016104640.mdf" providerName="System.Data.SqlClient" /> </connectionStrings> <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> <compilation debug="true" targetFramework="4.5" /> <httpRuntime targetFramework="4.5" /> <authentication mode="Forms"> <forms loginUrl="~/Account/Login" timeout="2880" /> </authentication> <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.Optimization" /> <add namespace="System.Web.Routing" /> <add namespace="System.Web.WebPages" /> </namespaces> <controls> <add tagPrefix="ext" namespace="Ext.Net" assembly="Ext.Net" /> </controls> </pages> <httpHandlers> <add path="*/ext.axd" verb="*" type="Ext.Net.ResourceHandler" validate="false" /> </httpHandlers> <httpModules> <add name="DirectRequestModule" type="Ext.Net.DirectRequestModule,Ext.Net" /> </httpModules> </system.web> <system.webServer> <validation validateIntegratedModeConfiguration="false" /> <handlers> <remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" /> <remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" /> <remove name="ExtensionlessUrlHandler-Integrated-4.0" /> <add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%Microsoft.NETFrameworkv4.0.30319aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" /> <add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="GET,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%Microsoft.NETFramework64v4.0.30319aspnet_isapi.dll" preCondition="classicMode,bitness64" responseBufferLimit="0" /> <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,OPTIONS" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" /> <add name="DirectRequestHandler" verb="*" path="*/ext.axd" preCondition="integratedMode" type="Ext.Net.ResourceHandler" /> <add name="ExtNetHandler" path="*/ext.axd" verb="*" type="Ext.Net.ResourceHandler" /> </handlers> <modules> <add name="DirectRequestModule" preCondition="managedHandler" type="Ext.Net.DirectRequestModule,Ext.Net" /> </modules> </system.webServer> <runtime> <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" /> <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" /> <bindingRedirect oldVersion="1.0.0.0-4.0.0.0" newVersion="4.5.7" /> <assemblyIdentity name="Ext.Net.Utilities" publicKeyToken="2c34ac34702a3c23" /> <bindingRedirect oldVersion="0.0.0.0-2.0.0" newVersion="2.0.1" /> </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="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" /> </dependentAssembly> </assemblyBinding> </runtime> <extnet theme="Gray" /> </configuration> 解决方法
>将Ext.Net添加到< system.web>中的程序集
<compilation debug="true" targetFramework="4.0"> <assemblies> .... <add assembly="Ext.Net"/> </assemblies> </compilation> >在< system.web>中添加名称空间 <pages> <namespaces> .... <add namespace="Ext.Net"/> <add namespace="Ext.Net.MVC"/> </namespaces> </pages> >更正geoffrey.mcgill帖子中的assemblyBinding <pages pageBaseType="System.Web.Mvc.WebViewPage"> <namespaces> .... <add namespace="Ext.Net" /> <add namespace="Ext.Net.MVC" /> </namespaces> </pages> >在Views文件夹中的web.config中添加Ext.Net程序集(在< system.web>部分中) <pages ....> <controls> .... <add assembly="Ext.Net" namespace="Ext.Net" tagPrefix="ext" /> </controls> </pages> (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- asp.net-mvc-4 – 带有TextBoxFor的MVC在循环中具有相同的i
- ASP.NET Azure中的Trace.WriteLine
- 多线程异步编程示例和实践-Thread和ThreadPool
- asp.net-identity – UserManager RemoveFromRole错误
- ASP.NET MVC another entity of the same type already has
- 如何为新项目决定WebForms vs ASP.NET MVC 3?
- asp.net-mvc – 在IIS 5.1上部署ASP.NET MVC(Windows XP)
- asp.net – 程序集与Windows Azure上的IIS使用的64位处理器
- asp.net – 如何停止插入两次的配置转换插件?
- asp.net – HttpPostedFileBase.SaveAs方法问题
推荐文章
站长推荐
- 您的登录尝试未成功.请再试一次.在asp.net虽然密
- asp.net-mvc – 你在哪里把你的验证放在asp.net
- asp.net-mvc – 如何从ASP.NET MVC的部分视图中获
- 具有嵌套列表的ASP.NET MVC DefaultModelBinder
- asp.net-mvc – 返回HttpPostedFileBase以查看验
- asp.net-mvc – 带有用Angular2编写的部分的ASP.
- asp.net-mvc-2 – ASP.NET MVC 2多个PartialView
- asp.net-mvc – 将自定义属性添加到MSBuild任务
- asp.net – 消息处理程序和Http模块?
- asp.net-mvc – 奇怪的MVC问题
热点阅读