Copied to clipboard

Flag this post as spam?

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


  • Ian Robinson 76 posts 140 karma points
    May 22, 2013 @ 17:32
    Ian Robinson
    0

    TempData not appearing in Redirect

    Hi,

    Using Umbraco 6.0.5, I have a surface controller method that is updating some membership details after the user posts a form.

    At the end of the method, I'm updating my TempData with a message to display to the user.  My master layout displays the contents of TempData("CustomMsg") if it's populated.  This is working for about 5 other controller methods and views when calling RedirectoToCurrentUmbracoPage().

    When I want to redirecto to any other page and I use the method Redirect("page name"), TempData is not displayed by the master layout.

    Does anyone know why or what I'm doing wrong?  Thanks.

    TempData.Add("CustomMsg"new AppMsg() { Type = "success", Msg = "Your email has been updated.  Please check your inbox and validate your email before trying to log in again." });
                    TempData.Keep("CustomMsg");
                    return  Redirect("/login.aspx?signout=true");

     

  • Ian Robinson 76 posts 140 karma points
    May 23, 2013 @ 18:50
    Ian Robinson
    0

    Anybody have a clue as what I'm doing wrong?  I can provide more information if that would help?

     

  • Andreas Iseli 150 posts 427 karma points
    May 24, 2013 @ 09:42
    Andreas Iseli
    0

    There once was a bug with TempData, but I'm not shure if the bug still exists.

    Anyway you should ensure that your session is configured properly. Can you once test if you can access and use the Session property of the SurfaceController class for your purpose?

Please Sign in or register to post replies

Write your reply to:

Draft