Asp – Where should I put the asp.net-mvc strongly typed viewdata

asp.net-mvcconventionsviewdata

I've been nesting my viewdata classes inside my controllers and, as their numbers grow, I'm starting to ask myself if this is a good idea. Then again, something about polluting the /Views and /Controllers directories with these things seems off.

Is there a convention I'm missing here? Maybe a /ViewData directory? idk, what are some good locations for my viewdata classes?

Best Answer

I did exactly what you're suggesting, I have my strongly typed viewdata living in /ViewData. I thought about putting it in the \Model directory but I don't like my projects having too many nested directories. the \ViewData is also what Kigg does.