I have implemented a login form that utilizes the login controller, which serves as a base controller. While the controller functions properly, my concern lies with error handling. Regrettably, I am unable to display error messages within the form as there is no means to return error messages from the controller. I would greatly appreciate any assistance in resolving this issue.
2
Answers
You could try return error message using
ViewBag
Then use
@ViewBag.Error
in razor to display message.Please refer to the Microsoft documentation at the following link:
Microsoft Documentation – ASP.NET Core MVC Validation