Popup Main Window Refresh

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

ok i have two forms. Customer.aspx and Parent_Searh.aspx. There is a button
on Customer.aspx that when executed runs javascript code to open up
parent_search as a popup. After the user searches for the parent and finds
the proper parent in the datagrid they then click on the accept button in the
grid. Then I populate a session variable with the parent ID. I then go back
to the main page and have it refresh using:

window.opener.location.href = window.opener.location.href;

and the parent information is displayed on the screen. Problem is the
command above does a refresh and not a postback so when it hits the line

if not ispostback then

it runs that if statement and refreshes all the fields thus losing any info
added before selecting the parent. Question how do i refresh with a postback?
 
the only problem with this is i need to know how to call a postback call to
customer.aspx from parent.aspx
 
All you have to do is call it from client side script the same way you
were setting the location. I would setup a client side refresh method
on the parent.aspx page that was wired up to its postback along the
lines of:
function Refresh(){...}
then I'd call it from customer.aspx using:
window.opener.Refresh();

That should do it.

John M Deal, MCP
Necessity Software
 
For anyone's future reference this is what i did. I added a hidden button
named
btnPostBack with causesvalidation=false. Then on the popup window side I
called the button clickwith this code

window.opener.frmCustomer.btnPostBack.click();

That did a postback to customer.aspx.
 
Back
Top