0

View で Dictionary にアクセスしようとしています。しかし、次の構文:

@{
    var indexList = Viewbag.IndexList as Dictionary<int,long>;
}

動作しません: The name 'Viewbag' does not exist in the current context

PS: Viewbag の前に「@」を配置しようとしましたが、まだ動作しません。

誰かが助けることができますか?前もって感謝します

4

2 に答える 2

5

ViewBagではありませんか?

var indexList = ViewBag.IndexList as Dictionary<int,long>;
于 2012-04-13T07:53:37.293 に答える