【问题标题】:In MVC, how to add intellisense to the html helpers在 MVC 中,如何将智能感知添加到 html 助手
【发布时间】:2016-01-11 20:59:10
【问题描述】:

我想知道是否有办法让智能感知与 mvc 助手的 html 属性一起工作,例如

@Html.EditorFor(m=>m.FieldName, new {@class="from-control col-md-3"})

有没有办法让智能感知进入内部(@class= "... here ..." )?

【问题讨论】:

  • 此语法中的 HtmlAttributes 只是一个 object 类。 Intellisense 无法正常工作。
  • 没有。这就是为什么 .Net 开发人员对没有人可以使用他们添加到 Visual Studio 2013 中的所有智能感知并在 2015 年将所有内容都更改为标签助手而感到不安的原因。

标签: html css asp.net-mvc visual-studio razor


【解决方案1】:

因为 @Html.EditorFor(m=>m.FieldName, new {@class="from-control col-md-3"}) 是 C# 代码,所以 intellisense 不起作用,所以 css intellisense 在 c# 中不起作用。

【讨论】:

    【解决方案2】:

    您是否尝试过在 Visual Studio 中使用“Web Essentials”扩展?

    【讨论】:

    • 我已经在 Visual Studio 2015 中使用它,但没有选项支持这种情况。
    猜你喜欢
    • 2016-03-09
    • 2012-02-13
    • 1970-01-01
    • 2018-05-31
    • 2011-01-28
    • 2010-11-21
    • 2022-12-18
    • 2016-11-23
    • 1970-01-01
    相关资源
    最近更新 更多