EF prompts a message in the controller, efcontroller
Method 1:
Return Content ("<script> alert ('this name already exists in the course again! '); Window. location. href = 'course/create' </script> "," text/html ");
In this way, the pop-up box is displayed. This method is suitable for deletion and query operations and supports page jump from the current window.
Method 2:
Return RefreshParent ("hello ");
In this way, you can pop up a prompt, jump to the page or refresh the page in the parent form of the current window.
For example:
If you want to bring up a prompt on the editing page and jump to another page on the editing page, or keep the current editing page not redirected, use the first method.
If you want to achieve another effect, for example, after clicking submit, you are prompted that the user is successfully edited, and then the current window and parent window are refreshed, you can use the second method, put the prompt statement to be popped up in RefreshParent.
For example:
Return RefreshParent ("submitted successfully ");
In this way, you can.