Open Closed

How to close modals when click button Exit #3391


User avatar
0
thaithiendi created

Dear support Team,

I have a button on Modal, when click i want to close Model, but i don't know how to call "Modal.close()"

  • ABP Framework version: v4.4.0
  • UI type: MVC
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace:
  • Steps to reproduce the issue:"
Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

6 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    var myModal = new abp.ModalManager({
        //...options
    });
    
    //Open the modal
    myModal.open();
    
    //Close the modal
    myModal.close();
    
    

    https://docs.abp.io/en/abp/latest/UI/AspNetCore/Modals

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    thaithiendi created

    Sorry maliming,

    But i mean i want to code button Exit like button Cancel. I'm coding on abp-modal. <abp-modal-footer buttons="@(AbpModalButtons.Cancel|AbpModalButtons.Save)"></abp-modal-footer> <abp-button id="btnExit" text="@L["Exit"].Value" button-type="Primary" />

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    You can try to add close class to the button

    class="close" data-dismiss="modal" aria-label="Close"

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    thaithiendi created

    Thanks maliming, That code is what i need.

    One more question: How i can refesh content of Modal when I click a button on that Modal. Because When I click the button, something will change the value in database. And I want to refesh content Modal to update for user.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    You can bind an event callback for this button and get the latest data from the backend, then update the values.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    thaithiendi created

    Thanks maliming.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on October 05, 2026, 11:32
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.