在.NET MVC3剃刀命名空间参考在VB中查看? [英] Namespace reference in .NET MVC3 Razor view in VB?
本文介绍了在.NET MVC3剃刀命名空间参考在VB中查看?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我如何引用.NET MVC3命名空间与剃刀视图引擎?
How do I reference a Namespace in .NET MVC3 with the Razor view engine?
我明白这一点可以在C#来完成:
I understand this can be done in C#:
@using Namespace;
然而在VB中这似乎并没有工作:
However in VB this doesn't seem to work:
@Imports Namespace
(我说的是一个.vbhtml文件中)
(i'm talking about inside a .vbhtml file)
推荐答案
您正在使用VB正确的语法:
You're using the correct syntax for VB:
@Imports My.Full.Namespace
我在一个快速戏已经找到了解决办法是:
What I've found in a quick play around is:
- 的MVC项目的子命名空间将被智能感知,一旦
@Imports
语句添加回升 - 必须是完整的命名空间 - 如果您正在引用当前MVC项目之外的命名空间,然后将智能感知不把它捡起来,除非你重建。
- Sub namespaces of the MVC project will be picked up by intellisense once the
@Imports
statement is added - must be the complete namespace. - If you're referencing a namespace outside of the current MVC project then intellisense won't pick it up unless you do a rebuild.
这篇关于在.NET MVC3剃刀命名空间参考在VB中查看?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文