ActionFilterAttribute and no Controller functions

Last post 03-18-2008 4:37 AM by levib. 2 replies.

Sort Posts:

  • ActionFilterAttribute and no Controller functions

    03-18-2008, 12:13 AM
    • Member
      638 point Member
    • jbardrof
    • Member since 03-22-2007, 11:47 PM
    • Naples FL
    • Posts 192

    Alright, So I've begun to look at the ActionFilterAttribute.  One thing I've noticed is there is no access to the RedirectToAction or RenderView methods. These methods are protected by the Controller class and therefore unaccessible under the filterContext.Controller.    

     In my mind I can find several valid reasons why I would want to add an attribute and then possibly short circuit the action with another Redirect or Render.  The only way I've found to get around this is to create my own base controller in which i override these methods and make them public. This seems like a less than ideal situation. 

     

    Any thoughts?
     

    Remember if you have gotten your answer to mark your thread as answered.
  • Re: ActionFilterAttribute and no Controller functions

    03-18-2008, 1:16 AM
    • Contributor
      4,358 point Contributor
    • tgmdbm
    • Member since 12-17-2007, 2:08 PM
    • Posts 881
    • ASPInsiders
      TrustedFriends-MVPs

    Absolutely! This is one of the many instances that the access level has hurt me. It's all over the place. For instance Html.ResolveUrl is internal, It should be public and it should be Url.Resolve
     

    I think the team have purposefully set a lot of things to internal, or protected, or non-virtual to see how many people scream about it. And I don't think enough people are.

    This is exactly the kind of response they're looking for. A real example of something you have to hack at get working. Keep it up

     

  • Re: ActionFilterAttribute and no Controller functions

    03-18-2008, 4:37 AM
    Answer
    • Contributor
      4,312 point Contributor
    • levib
    • Member since 07-23-2007, 7:50 PM
    • Redmond, WA
    • Posts 764
    • AspNetTeam

    Around the MIX timeframe, after the Preview 2 code was finalized, the team looked at what they had wrought.  While we're quite proud of the technical achievements of the MVC codebase, this means nothing if customers are ripping their hair out trying to use it.  Your pain should be our pain.  Phil posted about this, so I won't rehash everything here, but the issues you call out are definitely on our radar.  And while I'm not in a position to speak officially or to make specific guarantees regarding future releases, based on the team's prototype work in this area I hope that the two of you and the rest of the developer community will find this much more pleasant going forward. :)

    Note that progress comes because of the excellent feedback provided by the developer community in this and in other forums.  To that regard, thank you!

Page 1 of 1 (3 items)