Hi i’m using MVC3 and i’m in the C# environment. I would like to have a popup show when an else statement is satisfied.
the code looks like this:
if (validate.Count < 1) {
db.TutorStudents.Add(tutorStudent);
db.SaveChanges();
return RedirectToAction("Index");
} else {
// need some form of popup message here that does not redirect the user
}
I’ve been searching and I found JQuery solutions, but they work on a click result right… rather, I want the popup to work when the else statement is reached. Any solution is welcome.
Thank you in advance
You can’t show popup on the client side from the server directly.
But you can put some marker value to the
ViewDataorViewBagand pass this value to the script in your view:in the action
in the view