Best practice to persist data between requests

I want to be able to popup a simple message to the user after they perform simple operations. For instance, user deletes a record, I redirect the user to the “/” route and then using the toastr js api confirming the previous action. In MVC I would have used the ViewBag feature but not sure what the best method is in SS.

I’d personally avoid the ViewBag and be explicit about all view data by populating them in the returned ViewModel DTO, but you can attach any per-Request Data to base.Request.Items[] Dictionary which is also available in your Razor Views at the same location, i.e. base.Request.Items.

But if you’re going to redirect them, I’d just add a flag to the QueryString or Hash Param on the Redirect URL.

There’s also the base.SessionBag if you want to store adhoc data in a Users Session for params you want to survive a browser redirect.