/    Sign up×
Community /Pin to ProfileBookmark

Passing a reference to the calling window using window.open

Hello,
I need to show an ASP.NET page as a dialog using JavaScript, but the problem is that I can not use showModalDialog ‘cos ASP.NET postbacks can’t be processed within it and will have to open another window. So I wanna simulate the Dialog’s behavior using window.open. The thing is I need to pass a reference to the window that caused this dialog window to open so that the dialog would change the value of a hidden field value in the calling page. How can this be done?

Thanks in advance
Zee_AlieN

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@KorJul 13.2004 — The references are

To manipulate an object or to call a method/function

1. from opener to popup

- set a variable as the new object(window)

var newpage=window.open('newpage.html','name_or_target','other_attributes');

  • - now the references are


  • newpage.document.[i]object[/i]

    newpage.[i]a_function()[/i]

  • 2. from popup to opener

    window.opener.document.[i]object[/i]

    window.opener.[i]a_function()[/i]
  • ×

    Success!

    Help @zee_alien spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 6.2,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @meenaratha,
    tipped: article
    amount: 1000 SATS,

    tipper: @meenaratha,
    tipped: article
    amount: 1000 SATS,

    tipper: @AriseFacilitySolutions09,
    tipped: article
    amount: 1000 SATS,
    )...