vb.netasp.net-mvc-3rtmrazor

Namespace reference in .NET MVC3 Razor view in VB?


How do I reference a Namespace in .NET MVC3 with the Razor view engine?

I understand this can be done in C#:

@using Namespace;

However in VB this doesn't seem to work:

@Imports Namespace

(i'm talking about inside a .vbhtml file)


Solution

  • You're using the correct syntax for VB:

    @Imports My.Full.Namespace

    What I've found in a quick play around is: