【发布时间】:2012-11-06 08:57:35
【问题描述】:
我有一个强烈绑定到视图模型的剃刀视图:
@model MyNamespace.MyViewModel
我想在同一个视图页面中创建另一个视图模型的实例并使用它:
@test = new MyNamespace.AnotherViewModel();
@test.SomeAction();
我收到编译错误:
The name 'test' does not exist in the current context
我对 asp.net mvc 非常陌生,无法使其工作。任何帮助将不胜感激。谢谢!
【问题讨论】:
标签: c# asp.net-mvc razor asp.net-mvc-4