MVCContrib便携式区域没有智能感知的ViewPage< T>

编程入门 行业动态 更新时间:2024-10-26 16:25:05
本文介绍了MVCContrib便携式区域没有智能感知的ViewPage< T>的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我尝试使用MVCContrib便携领域。一般来说,这些工作得很好,它似乎是Web项目之间共享控制器\\美景的好方法。

这是我遇到的唯一问题是,智能感知(具体而言,为的HtmlHelper)未在视图中工作的强类型的观点,即的ViewPage。然而,智能感知工作的时候认为是一个普通的'醇System.Web.Mvc.ViewPage

有一个类似的问题已经在这里问:MvcContrib便携式领域的智能感知查看?

但这些建议似乎没有任何区别。

我使用MVC 2,便携式领域是在自己的类库作为MVCContrib样品code。我还想补充一点,MVC示例,code使我有同样的行为,如果我改变示例项目,使强类型的,那么该视图页面智能感知停止工作。

有同样问题的其他人呢?

有谁知道原因和解决方案或?

从我的浏览文件夹中的web.config如下:

<?XML版本=1.0&GT?;<结构>  <&的System.Web GT;    <&HttpHandlers的GT;      <添加路径=*动词=*          键入=System.Web.HttpNotFoundHandler/>    < / HttpHandlers的>    <! -         启用针对网页请求验证会导致验证出现        之后的输入已经由控制器处理。默认        MVC控制器处理输入之前执行请求验证。        要改变这种行为适用ValidateInputAttribute到        控制器或者动作。     - >    <页面        validateRequest =假        pageParserFilterType =System.Web.Mvc.ViewTypeParserFilter,System.Web.Mvc,版本= 2.0.0.0,文化=中性公钥= 31BF3856AD364E35        pageBaseType =System.Web.Mvc.ViewPage,System.Web.Mvc,版本= 2.0.0.0,文化=中性公钥= 31BF3856AD364E35        userControlBaseType =System.Web.Mvc.ViewUserControl,System.Web.Mvc,版本= 2.0.0.0,文化=中性公钥= 31BF3856AD364E35>      <控制与GT;        <添加组件=System.Web.Mvc,版本= 2.0.0.0,文化=中性公钥= 31BF3856AD364E35命名空间=System.Web.Mvc标签preFIX =MVC/>      < /控制>    < /页>  < /system.web>  < system.webServer>    <验证validateIntegratedModeConfiguration =FALSE/>    <&处理GT;      <清除NAME =BlockViewHandler/>      <添加名称=BlockViewHandler路径=*动词=*preCondition =integratedModeTYPE =System.Web.HttpNotFoundHandler/>    < /处理器>  < /system.webServer>< /结构>

解决方案

这是在VS2010 ReSharper的智能感知,ReSharper的V5.0的一个问题。如果我改变我的ReSharper的选项(ReSharper->选项 - > Intellisense->常规)使用Visual Studio智能感知那么它的作品!

I am trying out portable areas using MVCContrib. In general these work well and it seems to be a good way to share controllers\views between web projects.

The only problem that I'm having is that Intellisense (specifically, for the HtmlHelper) is not working in the view for strongly typed views i.e. ViewPage. The intellisense does work however when the view is a plain 'ol System.Web.Mvc.ViewPage

A similar questions has been asked here: MvcContrib Portable Areas View Intellisense?

But these suggestions don't seem to make any difference.

I am using MVC 2, the portable areas are in their own class library as in the MVCContrib sample code. I'd also like to add that the MVC sample code gives me the same behaviour, if I change the sample project to make the view page strongly typed then intellisense stops working.

Are other people having the same problem ?

Does anyone know the cause and or solution ?

the web.config from my Views folder is as follows:

<?xml version="1.0"?> <configuration> <system.web> <httpHandlers> <add path="*" verb="*" type="System.Web.HttpNotFoundHandler"/> </httpHandlers> <!-- Enabling request validation in view pages would cause validation to occur after the input has already been processed by the controller. By default MVC performs request validation before a controller processes the input. To change this behavior apply the ValidateInputAttribute to a controller or action. --> <pages validateRequest="false" pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> <controls> <add assembly="System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" namespace="System.Web.Mvc" tagPrefix="mvc" /> </controls> </pages> </system.web> <system.webServer> <validation validateIntegratedModeConfiguration="false"/> <handlers> <remove name="BlockViewHandler"/> <add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler"/> </handlers> </system.webServer> </configuration>

解决方案

This was a problem with ReSharper intellisense in VS2010, ReSharper v5.0. If I change my ReSharper options (ReSharper->Options->Intellisense->General) to use Visual Studio intellisense then it works!!

更多推荐

MVCContrib便携式区域没有智能感知的ViewPage&LT; T&GT;

本文发布于:2023-11-10 00:34:39,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1573872.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:区域   智能   MVCContrib   GT   LT

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!