if all my views are passed a strongly typed viewdata, if they have a baseviewdata class, can I set a
Posted
by Blankman
on Stack Overflow
See other posts from Stack Overflow
or by Blankman
Published on 2010-06-07T13:59:04Z
Indexed on
2010/06/07
14:02 UTC
Read the original article
Hit count: 188
ASP.NET
|asp.net-mvc
I want all my views to inherit from a baseview data so I can set some shared properties that all my views will need.
Can I set some properties in OnExecuting so I don't have to do it for all Actions?
I want to then display the string value of the property in all my view pages.
If yes, how can I do this? I need to hook into the base view data somehow?
so i'll have:
public MyViewData : ViewData { }
And I need one for generics also?
© Stack Overflow or respective owner