EF prompts a message in the controller, efcontroller

Source: Internet
Author: User

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.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.