خرید بک لینک

Vote count: 0

I'm new to Action Filters in general and have always wanted to know how it worked. This looks like a good opportunity to lea...

We're replacing the UI for a Castle Monorail app and I'd like to keep the functionality of or implement something similar to the [Resource] attribute it provides as a custom action filter that writes the strings to the viewbag so that we can write them to a JSON object in global-ish scope and use them in JavaScript.

Currently, we decorate controller classes like this (of course I'd be decorating the controller methods, instead):

[Resource("common", "namespace.Resources.Common")]
[Resource("events", "namespace.Resources.Events")]
[Resource("people", "namespace.Resources.People")]
public class someController : BaseController

My question is this: "How do I write an action filter that builds a list of resources from the individual uses and deposits them into a model or viewbag variable?" ... or possibly ... "How do I write an action filter that can be called multiple times without overwriting data from previous calls?"

I've read the tutorials and articles I could find, but any info I've found about multiple calls to an action filter on a single controller method is almost certainly about controlling order of execution rather than how it is actually implemented.

I welcome any code/pseudo code to demystify this for me.

Thanks in Advance

asked 2 mins ago

برچسب: نویسنده: استخدام کار تاريخ: شنبه 29 خرداد 1395 ساعت: 2:11

صفحه بندی