0
關於列表
List<Class1> listClass
在我的.cshtml文件。不過,我不能在.cshtml文件中創建下面的代碼,因爲它不承認
Class1的類:
@ {
List<Class1> listClass = new List<Class1>();
}
<html>
<!-- code for the view goes here -->
</html>
的Class1和.cshtml文件位於不同的命名空間。任何幫助將不勝感激。
怎麼樣添加使用您的CSHTML文件:'@using MyNamespace'? –
[我如何在Razor View Page中導入名稱空間?](https://stackoverflow.com/questions/3239006/how-do-i-import-a-namespace-in-razor-view-page) – apocalypse