public void DeleteUser(User user)
{
if (!UserExists(user))
throw new ArgumentException("User doesn't exist!");
else
{
MatrixDb.Users.Remove(user);
MatrixDb.SaveChanges();
}
}
I want to show that "ArgumentException" message in a proper way on the page; I want it inside the ValidationSummary Helper or a Label, so that when the User faces it, they are not sent to 'Server Error in '/' Application' Page rather, the error is shown in some Controller, like a Label or Textfield.
Is this even possible?! Because on the Server Page that's shown when the ArgumentException is raised, does show that message there!