locked
How to update parent page after AJAX Model Popup Extender closes without postback? RRS feed

  • Question

  • User2072444018 posted

    Hi guys .. Before I describe my problem, please note that I'm using MVC and not Web forms. Meaning the solution needs to work within MVC.

    I have a button on an ASP.NET page (let's call it Parent Page), which when I press, opens a modal popup which has a form in it which the user fills in. When the form is submitted, I'd like to display the data the user entered in the modal popup on the Parent Page, without doing a postback. How can this be achieved while using MVC ?

    The Models I'm using are given below. The Parent Page is for creating a Team, and the modal popup with take details of a Player. The details are then to be shown on the Parent Page in a grid-like view.

    public class Team
    {
    public int ID {get; set;}
    public string name {get; set;}
    public string slogan {get; set;}
    public string homeCity {get; set;}
    public List<Player> players {get; set;}
    }
    
    public class Player
    {
    public int ID {get; set;}
    public string fullName {get; set;}
    public int age {get; set;}
    public string height {get; set;}
    }



    Saturday, April 4, 2015 5:36 PM

Answers

  • User1711366110 posted

    I have a button on an ASP.NET page (let's call it Parent Page), which when I press, opens a modal popup which has a form in it which the user fills in. When the form is submitted, I'd like to display the data the user entered in the modal popup on the Parent Page, without doing a postback. How can this be achieved while using MVC ?

      When you submit the Form through ajax, you return the view of the parent page (complete page, or parent view). With simple jquery statements, you can close the modal popup, and then replace the page with the updated view. That's the easiest way.
    You can extend this with partial view, so you don't lose the state of the parts of your page
     
    For more information, refer the following similar link which was posted by you .

    http://stackoverflow.com/questions/29478994/parent-window-partialview-update-after-modal-popup-closes

    --
    with regards,
    Edwin

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, April 7, 2015 3:41 AM