/    Sign up×
Community /Pin to ProfileBookmark

Reload of parent window from pop up window

In my aspx page, I have a button. If the user clicks on this button then a Javascript function is called which checks whether user is logged in or not. If he is logged in then some operation is performed using Javascript, otherwise a pop up window is opened where user is asked for login details.

This is my code inside Javascriopt fucntion
if(top.HolderForm.LogOn.value == ‘false’) {
loginWindow = window.open(‘LogOn.aspx’,’login’,’height=300,width=500′);
if (window.focus) {loginWindow.focus()}

}
else
{..

When user enters correct user name and password then pop up window should be closed and user should be directed to some page. In the aspx.cs file where I am doing this is

//check whether user name and password are correct
if(webservice1.login(username, password)) {

Response.Write(“<script>opener.location.reload(true);self.close()</script>”);
}

But the problem is that the opeer page is an iFrame inside the main page. So when this code executes opener.location.reload(true), only the frame is refreshed. i want the whole page to be refreshed. In other words, the parent of the iFrame that is the opener for the pop up window should be refreshed. please let me know how to do this.

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@samliewDec 24.2007 — try (from inside the iframe):

window.opener.location.reload(true);
×

Success!

Help @anshulk 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 5.18,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

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

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...