Hi @Coreysan,
Should I modify this line, or use tempdata, or other?
Firstly you need know that RedirectToAction
will redirect to the action with route object. That is to say the object will display in the address bar.
- If the object is small and not sensitive, your current approach is fine.
a. Pass simple type data should be like:
b. Pass complex type model should be like:return RedirectToAction("YourAction", "YourController", new{id=1});
var model = /*create a model*/; return RedirectToAction("YourAction", "YourController", model);
- If the object is larger or sensitive, consider TempData or Session.
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Best regards,
Rena