views:

33

answers:

1

Similar to using Shortcut = System.Whatever; in the cshtml I have so far been out of luck doing something similar in the webconfig

<pages>
  <namespaces>
    <add namespace="System.Web.Routing" as="Routing" />
  </namespaces>
</pages>

Something like that...Is it possible at all?

+1  A: 

No, it is not possible in Razor because there is no mechanism in C# that would allow you to redefine a namespace.

marcind
Well, the reason I bring it up is because you can define an alternate name in c#. `using shortname = System.Text` is one example but that's on a per file basis.
BuildStarted
@Morder technically it's on a per-type basis :) In general you should think of Razor as an extension of C# (or VB); there are few additional concepts that it adds to the existing languages.
marcind
Yeah, I just hoped... :) Would be nice to have though. I've made it an HtmlHelper instead so that it's still a short type. Thanks.
BuildStarted