Refresh parent page

J

John

Hi,

I used the following code to refresh the parent page, and it works very well
(Thanks to Peter Bromberg [C# MVP]").

Response.Write("<script language='javascript' type='text/javascript'> {
window.opener.location = 'Default.aspx?Reload=100'; }</script>");
Response.Write("<script language='javascript' type='text/javascript'> {
self.close(); }</script>");

Now I changed those two lines (Reload=100#CDRW') to the following to refresh
the page and move to a specific section of the page.

Response.Write("<script language='javascript' type='text/javascript'> {
window.opener.location = 'Default.aspx?Reload=100#CDRW'; }</script>");
Response.Write("<script language='javascript' type='text/javascript'> {
self.close(); }</script>");

It works only in the first time.

Please help. Thanks.
 
G

Guest

Hi,

I used the following code to refresh the parent page, and it works very well
(Thanks to Peter Bromberg [C# MVP]").

Response.Write("<script language='javascript' type='text/javascript'> {
window.opener.location = 'Default.aspx?Reload=100'; }</script>");
Response.Write("<script language='javascript' type='text/javascript'> {
self.close(); }</script>");

Now I changed those two lines (Reload=100#CDRW') to the following to refresh
the page and move to a specific section of the page.

Response.Write("<script language='javascript' type='text/javascript'> {
window.opener.location = 'Default.aspx?Reload=100#CDRW'; }</script>");
Response.Write("<script language='javascript' type='text/javascript'> {
self.close(); }</script>");

It works only in the first time.

Please help. Thanks.

What is '100' in the URL? Maybe you extract it in the code somewhere
and forgot that it becomes '100#...'?
 
B

bruce barker

the 'Default.aspx?Reload=100#CDRW mean navigate to the #CDRW position of the
page, and load it if not loaded. if the page is loaded, it just navigate to
the position. just tack a dummy guid arg on:

Default.aspx?Reload=100&guid=e80bb06a-5516-4a88-963e-8262397abb05#CDRW

-- bruce (sqlwork.com)
 
J

John

It seems that it doesn't work. The page navigate to the position, but didn't
refresh (it did refresh in the first time).

Why can 'Default.aspx?Reload=100' refresh the page again and again, but
'Default.aspx?Reload=100#CDRW' refreshes the page only once?

I have a long list in the parent page, the user can edit the list using an
editing page, after closing the editing page, I want to bring the changes to
the user instead of letting them browse the long list to find the spot.

Thank you very much. At least I had something different to try.


bruce barker said:
the 'Default.aspx?Reload=100#CDRW mean navigate to the #CDRW position of the
page, and load it if not loaded. if the page is loaded, it just navigate to
the position. just tack a dummy guid arg on:

Default.aspx?Reload=100&guid=e80bb06a-5516-4a88-963e-8262397abb05#CDRW

-- bruce (sqlwork.com)


John said:
Hi,

I used the following code to refresh the parent page, and it works very well
(Thanks to Peter Bromberg [C# MVP]").

Response.Write("<script language='javascript' type='text/javascript'> {
window.opener.location = 'Default.aspx?Reload=100'; }</script>");
Response.Write("<script language='javascript' type='text/javascript'> {
self.close(); }</script>");

Now I changed those two lines (Reload=100#CDRW') to the following to refresh
the page and move to a specific section of the page.

Response.Write("<script language='javascript' type='text/javascript'> {
window.opener.location = 'Default.aspx?Reload=100#CDRW'; }</script>");
Response.Write("<script language='javascript' type='text/javascript'> {
self.close(); }</script>");

It works only in the first time.

Please help. Thanks.
 
B

bruce barker

as i stated, a navigate to an anchor will not refresh the page if its
loaded. thats by design. if you append a guid to the url it will be a
new url and will cause a refresh.

-- bruce (sqlwork.com)
It seems that it doesn't work. The page navigate to the position, but didn't
refresh (it did refresh in the first time).

Why can 'Default.aspx?Reload=100' refresh the page again and again, but
'Default.aspx?Reload=100#CDRW' refreshes the page only once?

I have a long list in the parent page, the user can edit the list using an
editing page, after closing the editing page, I want to bring the changes to
the user instead of letting them browse the long list to find the spot.

Thank you very much. At least I had something different to try.


bruce barker said:
the 'Default.aspx?Reload=100#CDRW mean navigate to the #CDRW position of the
page, and load it if not loaded. if the page is loaded, it just navigate to
the position. just tack a dummy guid arg on:

Default.aspx?Reload=100&guid=e80bb06a-5516-4a88-963e-8262397abb05#CDRW

-- bruce (sqlwork.com)


John said:
Hi,

I used the following code to refresh the parent page, and it works very well
(Thanks to Peter Bromberg [C# MVP]").

Response.Write("<script language='javascript' type='text/javascript'> {
window.opener.location = 'Default.aspx?Reload=100'; }</script>");
Response.Write("<script language='javascript' type='text/javascript'> {
self.close(); }</script>");

Now I changed those two lines (Reload=100#CDRW') to the following to refresh
the page and move to a specific section of the page.

Response.Write("<script language='javascript' type='text/javascript'> {
window.opener.location = 'Default.aspx?Reload=100#CDRW'; }</script>");
Response.Write("<script language='javascript' type='text/javascript'> {
self.close(); }</script>");

It works only in the first time.

Please help. Thanks.
 
J

John

It works. Thanks.

bruce barker said:
as i stated, a navigate to an anchor will not refresh the page if its
loaded. thats by design. if you append a guid to the url it will be a
new url and will cause a refresh.

-- bruce (sqlwork.com)
It seems that it doesn't work. The page navigate to the position, but didn't
refresh (it did refresh in the first time).

Why can 'Default.aspx?Reload=100' refresh the page again and again, but
'Default.aspx?Reload=100#CDRW' refreshes the page only once?

I have a long list in the parent page, the user can edit the list using an
editing page, after closing the editing page, I want to bring the changes to
the user instead of letting them browse the long list to find the spot.

Thank you very much. At least I had something different to try.


bruce barker said:
the 'Default.aspx?Reload=100#CDRW mean navigate to the #CDRW position of the
page, and load it if not loaded. if the page is loaded, it just navigate to
the position. just tack a dummy guid arg on:

Default.aspx?Reload=100&guid=e80bb06a-5516-4a88-963e-8262397abb05#CDRW

-- bruce (sqlwork.com)


:

Hi,

I used the following code to refresh the parent page, and it works very well
(Thanks to Peter Bromberg [C# MVP]").

Response.Write("<script language='javascript' type='text/javascript'> {
window.opener.location = 'Default.aspx?Reload=100'; }</script>");
Response.Write("<script language='javascript' type='text/javascript'> {
self.close(); }</script>");

Now I changed those two lines (Reload=100#CDRW') to the following to refresh
the page and move to a specific section of the page.

Response.Write("<script language='javascript' type='text/javascript'> {
window.opener.location = 'Default.aspx?Reload=100#CDRW'; }</script>");
Response.Write("<script language='javascript' type='text/javascript'> {
self.close(); }</script>");

It works only in the first time.

Please help. Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,211
Latest member
NelleWilde

Latest Threads

Top