Link to home
Start Free TrialLog in
Avatar of Camillia
CamilliaFlag for United States of America

asked on

Doable? child page close and parent page open new page

I wonder if this is doable:
I have a master page and default.aspx in on it. There's a hyperlink on it. I click it. Page2.aspx opens. I do whatever. I click submit. Now, instead of refreshing/going back to parent page which is default.aspx...i actually want to load page3.aspx in the master page.

So, instead of having default.aspx when page2.aspx closes, i actually want to load page3.aspx in parent page. Doable?
Avatar of Hube02
Hube02
Flag of United States of America image

Use: window.opener.location="page3.aspx'
Avatar of Camillia

ASKER

hmmm..how can i pass an id to page3.aspx??
if you mean as in a query string, just add it to the url:
window.opener.location="page3.aspx?id=123'
where does thsi window.opener.location go??

So, i have a submit button, goes to submit click event, so when do I call this JS??
ASKER CERTIFIED SOLUTION
Avatar of Samuel Liew
Samuel Liew
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
how can I NOT hardcode that id=123?? I have that id in my aspx page. How can I get it to the JS?
That I'm not sure. I use PHP and don't know .NET.

I would do something like:

<script type="text/javascript">
  window.opener.location = 'page3.aspx?id=<?php echo $id; ?>';
  window.close();
</script>


let me see how i can do it in .Net.