Hi @Neha , Welcome to Microsoft Q&A,
One of the solutions is similar to what you said about "closing". You can define a callback method through the parent window, and the child window calls this method when it is closed to pass the selected data back.
If the interaction scenario is fixed, this method is simpler. It requires custom events; data is passed only when the child window is closed.
If you need to process JSON messages and WebView2 supports WebMessage, you can use WebMessage to process dynamic pages and complex interactions without changing the page logic. You can execute JavaScript through ExecuteScriptAsync to actively send data to the page.
Best Regards,
Jiale
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
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.