468,115 Members | 2,103 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,115 developers. It's quick & easy.

Popup Main Window Refresh

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?
Jul 21 '05 #1
4 2825
Instead of resetting the href location you should manually trigger the
postback. The article at the following link shows how to do this and
you should be able to extend it to fit your needs.

http://www.xefteri.com/articles/dec102002/default.aspx

Hope that helps.

Have A Better One!

John M Deal, MCP
Necessity Software

Andrew Alger wrote:
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?

Jul 21 '05 #2
the only problem with this is i need to know how to call a postback call to
customer.aspx from parent.aspx

"John M Deal" wrote:
Instead of resetting the href location you should manually trigger the
postback. The article at the following link shows how to do this and
you should be able to extend it to fit your needs.

http://www.xefteri.com/articles/dec102002/default.aspx

Hope that helps.

Have A Better One!

John M Deal, MCP
Necessity Software

Andrew Alger wrote:
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?

Jul 21 '05 #3
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
Andrew Alger wrote:
the only problem with this is i need to know how to call a postback call to
customer.aspx from parent.aspx

"John M Deal" wrote:

Instead of resetting the href location you should manually trigger the
postback. The article at the following link shows how to do this and
you should be able to extend it to fit your needs.

http://www.xefteri.com/articles/dec102002/default.aspx

Hope that helps.

Have A Better One!

John M Deal, MCP
Necessity Software

Andrew Alger wrote:
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?

Jul 21 '05 #4
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.

"John M Deal" wrote:
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
Andrew Alger wrote:
the only problem with this is i need to know how to call a postback call to
customer.aspx from parent.aspx

"John M Deal" wrote:

Instead of resetting the href location you should manually trigger the
postback. The article at the following link shows how to do this and
you should be able to extend it to fit your needs.

http://www.xefteri.com/articles/dec102002/default.aspx

Hope that helps.

Have A Better One!

John M Deal, MCP
Necessity Software

Andrew Alger wrote:

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?

Jul 21 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Logger | last post: by
5 posts views Thread by Hemanth | last post: by
5 posts views Thread by Andrew Alger | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.