4
我有強烈綁定到一個視圖模型剃刀觀點:實例化一個對象4
@model MyNamespace.MyViewModel
我不想再拍視圖模型的實例在同一視圖頁面,並使用它:
@test = new MyNamespace.AnotherViewModel();
@test.SomeAction();
我收到編譯錯誤:
The name 'test' does not exist in the current context
我很新的asp.net的MVC,卻不能使它發揮作用。任何幫助將不勝感激。謝謝!
謝謝!這樣做的工作。 – Mdb