Hellow.i have a class Called Students where i have several methods.In my method for creating students,i first check if that student exists then i throw error back to him if found.What it brings back to me is the Exception since i have used a throw statement and it brings that annoying YELLOW SCREEN OF DEATH .I need someone to tell me how i can use a response.redirect so as instead of throwing that error,it redirects him to a custom error page i have created,
Here is the code on the Students Class
Student exist = db.Students.FirstOrDefault(x => x.studentName == studentName);
if (exist != null)
{
throw new Exception("Student Exists");
}
Mark as answer if satisfied