Donate

The name 'ViewData' does not exist in the current context

Good Evening!

In an application where I played the class diagram in visual studio by adding controller class, repository class, and service class, I encountered an error "The name 'ViewData' does not exist in the current context" in my HomeController.

This is weird since the controller references System.Web.Mvc. The solution is:

1. Copy the source code in the HomeController and transfer it in a textfile for backup.
2. Delete the original HomeController.
3. Add another HomeController class
4. paste the backup code from the textfile.

I guess this is a bug when using class diagrams in Visual Studio 2010.

Greg

Comments

Donate

Popular Posts From This Blog

WPF CRUD Application Using DataGrid, MVVM Pattern, Entity Framework, And C#.NET

How To Insert Or Add Emojis In Microsoft Teams Status Message

Pass GUID As Parameter To Action Using ASP.NET MVC ContribGrid