>From this thread: http://markmail.org/message/o27x3yli6faos2sb#query:+page:1+mid:o27x3yli6faos2sb+state:results
It sounds like Dynamic Actions are resolved before ASP.NET has provided MonoRail with the associated Session. Instead of conditionally adding the action based on role, I think you may want to change your approach so the role check is done inside the dynamic action code. --- Patrick Steele http://weblogs.asp.net/psteele On Sat, Sep 17, 2011 at 5:19 AM, Carlos <[email protected]> wrote: > Hi, fellows. I'm using monorail ver.1.0.3.00 under .net framework > 2.0.Yes I know the version is outdate,but my virtual host only > supports .net2.0,so I can't just upgrade. Anyway here' the problem: > > I'm trying to add some Dynamic actions to the controller by determine > the user's role in a Session[],this session was created the minute the > user logged in,and for now, it's always created to test the > function.But when I implement the > IDynamicActionProvider.IncludeActions(Controller controller) > function,I try to get the user's role from the > controller.Session[],but due to protection level the > controller.Session[] is not available.So I try to use the > controller.Context.Session[] ,but an null reference exception threw > out. > > Is there anyone who know the prolem can tell me why the Session[] is > always null at this place,and how can I get access to the Session[] > inside the IDynamicActionProvider.IncludeActions(Controller > controller) function. > > Many thanks. > > -- > 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. > > -- 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.
