0

I'm using ASP.NET Core 2.2 in my project, in one of action method, I am storing data in tempdata and redirecting to SSO site for user validation. Later in MethodB which is callback method i get user details. But when am trying to get details from tempdata that i stored in MethodA, i get always null. Infact i tried with using sessions too but that is also getting null if i use Response.Redirect but works fine when i use RedirectToAction. Its seems Respose.Redirect is causing issue. Do anyone can suggest what could be issue and any possible solution?

    [TempData]
    public string Message1 { get; set; }

    public void MethodA()
    {
        TempData["Message2"] = "Some Value";

        Response.Redirect("SSOSite.com");
    }

    public void MethodB()
    {
        var message1 = Message1;
        var message2 = TempData["Message2"];
    }
2
  • Did u check this stackoverflow.com/questions/41734039/…? Commented Dec 18, 2019 at 12:22
  • Yes, This problem occurs specifically when i use Response.Redirect otherwise its working perfectly when i use redirectoaction. Commented Dec 18, 2019 at 12:25

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.