1

I do some postdata handling on my webpage, but need some help with the redirecting.

How can i redirect as the code below does not work? I've breakpointed it and it enters RedirectToRoute function but goes to the return :(

            if (Session["auth"] != null)
                RedirectToRoute("/Home");

            return null;
Dennis Traub
  • 50,557
  • 7
  • 93
  • 108
Jason94
  • 13,320
  • 37
  • 106
  • 184

1 Answers1

2

You need to return the RedirectToRouteResult like this:

if (Session["auth"] != null)
    return RedirectToRoute("/Home");

return null;
Dennis Traub
  • 50,557
  • 7
  • 93
  • 108