Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Ismail Mayat 4511 posts 10092 karma points MVP 2x admin c-trib
    May 28, 2014 @ 17:11
    Ismail Mayat
    0

    ActionFilter redirect

    Guys,

    Using umbraco 6.1.6 and I have a surface controller with method:

            [Authorize]
            [NotFacebookUser]
            public ActionResult RenderAccountDetails()
            {
                var currentAccount = GetCurrentLoggedInAccount();
                return PartialView("~/Views/Partials/Account/Account.cshtml", currentAccount);
            }

    The NotFacebookUser is an actionfilter that i have created, what i want to do in there is redirect to the home page, I have tried a number of things http://stackoverflow.com/q/835672 each one gives me 

    Child actions are not allowed to perform redirect actions.

    So I have updated code for time being and I now have in my action filter attribute

    filterContext.Result = new HttpNotFoundResult();     

    So I now get blank where the child action was going to render.  What can i do to redirect to home page from my action filter? 

    Regards

    Ismail

     

     

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies