That's exactly what I was looking for. Thank you Jorge.
On 10 Feb., 22:28, Jorge Barnaby Rubio <[email protected]>
wrote:
> I do it this way:
>
> public class BaseSiteController : ARSmartDispatcherController
> {
> public override void Initialize()
> {
> base.Initialize();
>
> PropertyBag["siteCharset"] = "value";
> }
>
> }
>
> Hope it helps!
>
> yorch.
>
> On Feb 10, 5:28 am, Lee Henson <[email protected]> wrote:
>
> > One choice is to use a filter.
>
> > [Filter(ExecuteWhen.BeforeAction,
> > typeof(IPreloadBaseControllerPropertyBagFilter)]
> > public class BaseController {
>
> > }
>
> > public class PreloadBaseControllerPropertyBagFilter : IFilter {
> > public virtual bool Perform(.....) {
> > controllerContext.PropertyBag.Add("mykey", myvalue);
> > }
>
> > }
>
> > 2009/2/10 Ben Lovell <[email protected]>
>
> > > Could you override the propertybag and do your stuff there? I've not got
> > > VS
> > > open in front of me so that's a question as much as an answer ;)
>
> > > On Tue, Feb 10, 2009 at 7:59 AM, Flominator <[email protected]> wrote:
>
> > >> Hi there,
>
> > >> is there any way to fill some fields in the PropertyBag within my
> > >> BaseController from which all of my controllers are inherited? I want
> > >> to have those feeds available in every Action of every Controller
> > >> unless I change it there.
>
> > >> BaseController itself inherits from SmartDispatcherController. Maybe
> > >> there is some kind of hook that is called when initializing a
> > >> controller or something?
>
> > >> Thanks in advance,
>
> > >> Flo
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Castle Project Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/castle-project-users?hl=en
-~----------~----~----~----~------~----~------~--~---