From 6e48f87cad6676ba0120e94d4a51a964a38256e2 Mon Sep 17 00:00:00 2001 From: Mark J Price Date: Thu, 8 Jun 2023 11:09:16 +0100 Subject: [PATCH] Update improvements.md --- docs/errata/improvements.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/errata/improvements.md b/docs/errata/improvements.md index 6807962..ab2e53a 100644 --- a/docs/errata/improvements.md +++ b/docs/errata/improvements.md @@ -1055,13 +1055,13 @@ The project already has a page to show customers, either all of them or only tho **At the top of the Customers page** ```html -@if (ViewData["error-message"] is not null) +@if (TempData["error-message"] is not null) { -

Error! @ViewData["error-message"]

+

Error! @TempData["error-message"]

} -@if (ViewData["success-message"] is not null) +@if (TempData["success-message"] is not null) { -

Congratulations! @ViewData["success-message"]

+

Congratulations! @TempData["success-message"]

} AddCustomer(Customer customer) if (response.IsSuccessStatusCode) { - ViewData["success-message"] = "Customer successfully added."; + TempData["success-message"] = "Customer successfully added."; } else { - ViewData["error-message"] = "Customer was NOT added."; + TempData["error-message"] = "Customer was NOT added."; } // Show the full customers list to see if it was added. @@ -1154,11 +1154,11 @@ public async Task DeleteCustomerPost(string customerId) if (response.IsSuccessStatusCode) { - ViewData["success-message"] = "Customer successfully deleted."; + TempData["success-message"] = "Customer successfully deleted."; } else { - ViewData["error-message"] = $"Customer {customerId} was NOT deleted."; + TempData["error-message"] = $"Customer {customerId} was NOT deleted."; } // Show the full customers list to see if it was deleted.