Up until now, we've used the presence of errors within ModelState to know whether we should prepend 'Error: ' to the page title. However, we don't require that errors go into ModelState; they could be explicitly rendered by using the appropriate -error-message tag helpers.
This change moves to using a ViewData entry to know whether page has errors. The two error summary-producing tag helpers have been updated to set this to true so effectively if the page has an error summary component we infer the page has errors. There's also a pair of public extension methods to get and set this ViewData value, respectively.
Up until now, we've used the presence of errors within
ModelState
to know whether we should prepend 'Error: ' to the page title. However, we don't require that errors go intoModelState
; they could be explicitly rendered by using the appropriate-error-message
tag helpers.This change moves to using a
ViewData
entry to know whether page has errors. The two error summary-producing tag helpers have been updated to set this totrue
so effectively if the page has an error summary component we infer the page has errors. There's also a pair of public extension methods to get and set this ViewData value, respectively.