Search code examples
asp.net-mvcviewbag

Viewbag does not exist in the current context


I have checked all the possible solution for this on stack overflow like to clear cache file, to change version number in web.config file of Shared View Folder but still not able to solve this kind of issue in partial view

var count = parseInt('@Viewbag.FeedbackCount');

Can someone suggest better and clean solution for this rather than to mark it as duplicate?


Solution

  • It's ViewBag with a capital B instead of Viewbag.