filterattribute

Model dissapears between filter attribute OnException and Master

Right before I return from my OnException in the mvc contrib's Rescue filter I can see the filterContext.Result.ViewData.Model is filled. Then I return, pass a bunch of non-steppable code and the next thing I can see I'm in my master where my ViewData.Model is null. any ideas? ...

MVC/Unity - How to inject dependencies into custom FilterAttributes?

I Have a custom HandleErrorAttribute that extends FilterAttribute. How can I have Unity inject dependencies into this attribute at the same time that it injects the controller's dependencies itself? ...

Need some help with a custom ASP.NET MVC IExceptionFilter

Hi folks, i'm trying to make my own ExceptionFilter. Out of the box, ASP.NET MVC comes with the [HandleError] attribute. This is great -> but it returns some html error View. As such, I'm wanting to return some json error message. So i'm making my own. Now, everything works great until i test my url. I keep getting an error. this is t...

Preselecting values in mulitselect with jQuery

I have a set of values that are present on the page loading: eg [1193,1184,2372]. I have a dropdownchecklist which can take a single value like so $(".ddl").dropdownchecklist().val(1193); When I rebind the dropdownchecklist this selects the value correctly. However I've tried passing my array containing multiple values to the val() met...

ASP.NET MVC2 - Resolve Parameter Attribute in Model Binder

Given an action like: public ActionResult DoStuff([CustomAttribute("foo")]string value) { // ... } Is there any way to resolve the instance of value's CustomAttribute within a ModelBinder? I was looking at the MVC sources and chances are I'm just doing it wrong, but when I tried to replicate their code which retrieves the BindAttrib...

Is it possible to use Dependency Injection/IoC on an ASP.NET MVC FilterAttribute ?

Hi folks, I've got a simple custom FilterAttribute which I use decorate various ActionMethods. eg. [AcceptVerbs(HttpVerbs.Get)] [MyCustomFilter] public ActionResult Bar(...) { ... } Now, I wish to add some logging to this CustomFilter Action .. so being a good boy, I'm using DI/IoC ... and as such wish to use this pattern for my cus...