カスタム クラス MyCustomType があります。そのクラスには、bool 型のプロパティ MyCustomProperty と、bool 型の別のプロパティ MyCustomProperty1 があります。
ビューで MyCustomProperty が true かどうかを確認する必要があります。私は次のことをしています:
<%if ( TempData[ViewDataConstants.MyCustomTypeKey] != null && ((MyCustomType)TempData[ViewDataConstants.MyCustomTypeKey]).MyCustomProperty %>show some custom content.
しかし、何らかの理由で私m running it I see error message that MyCustomTYpe could not be found are you missing an assembly reference bla-bla-bla. MyCustomType is in my controller it
が公開されているときに、確認するためにビューへの参照を追加しました。しかし、MyCustomType クラスはないと言い続けています。私は何を間違っていますか?
興味深いことに、何らかの理由で Controllers 名前空間から Common に移動すると、突然機能しました。Controllers名前空間で動作しない理由はまだわかりません。両方の名前空間がビューに明示的に含まれていました。