Interaction between 2 window in MVC

Megha Chourasiya 1 Reputation point
2021-06-24T07:23:51.523+00:00

I have one button 'btndetach' on AssignInvoice.cshtml page. i have one partial view _AssignInvoicePDF on AssignInvoice.cshtml page.

I am opening new window on btndetach button click event.

function DetachImage() {
window.open('@URL .Action("AssignInvoicePDF", "Invoice")', "PopupWindow", 'width=500px,height=500px,top=150,left=250');
}

On new window i am showing PartialView _AssignInvoicePDF.( same partial view which i have on Main Page - AssignInvoice)

Now my my requirement is when i select any option on new window then i can fetch those selected option on Main page as i have save button on main page.

So how can i communicate between new window and Main window.

Thanks.

ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,598 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Yijing Sun-MSFT 7,091 Reputation points
    2021-06-25T05:33:45.42+00:00

    Hi @Megha Chourasiya ,
    As far as I think,you could add a method "SaveData" to window, so the child window can call parent method.
    Just like this:
    109200-new-text-document.txt
    Best regards,
    Yijing Sun


    If the answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our  documentation  to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.