0
public async Task<ActionResult> Index(tempUser userDetails)
        {

            temp.Name = userDetails.Name;
            temp.Pass= userDetails.Pass;

            db.tempUsers.Add(temp);
            db.SaveChanges();

            if (true)
            {
                await SendNotification();
                return RedirectToAction("NotificationUser", "SignUp", new { tempUser = userDetails});
            }
            else
            {
                return RedirectToAction("AAA");
            }
        }

I have a controller like above. How can I pass all result of temp (temp.Name, temp.Pass ...) into SignUp() method in the same controller NotificationUser.

Alex
  • 727
  • 1
  • 13
  • 32
  • `TempData` can be used to pass the data – Nkosi Nov 23 '19 at 01:53
  • @Nkosi Thanks for help. I just edited my question. – Alex Nov 23 '19 at 01:58
  • 1
    If you're trying to pass the data through the query string parameters then you'll need to split tempUser into name and pass. If `pass` is a password then you probably don't want to send it over the query string at all. In that case, `TempData` is what you want. – Jasen Nov 23 '19 at 02:07

0 Answers0