开发者

Possible to add shortcut names to razor namespace imports in MVC 3 web.config

开发者 https://www.devze.com 2023-01-15 23:06 出处:网络
Similar to using Shortcut = System.Whatever; in the cshtml I have so far been out of luck doing something similar 开发者_Python百科in the webconfig

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

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

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


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号