Default to true - This page cannot be refreshed without sending the information

Hello Experts,

I currently have an asp.net web application for internal use in our company.  It allows the user to open a popup window, update some data, then close the popup window.  Closing the popup window then refreshes the parent window with the new data.

This is all working.  Except they get the message "This page cannot be refreshed without sending the information.  Retry - Cancel".  That's fine, it's the intent for it to update the parent window with the modified information.  The problem is, the users don't want to have to click the retry button every times this happens.  They want it to default to true and just update the page.  How can I do this?

Here's the javascript I'm using to reload the parent window and close the popup.  I guess I'm looking for something like "Reload(True)" to default it to true without user intervention.  Retargetting to the parent url will not work as there are a ton of user selected fields that need to be remembered on post back.

Thanks!
Maurice
btnClose.Attributes.Add("onClick", "window.opener.location.reload();window.close();")

Open in new window

LVL 2
GRCHELPDESKAsked:
Who is Participating?
 
Melih SARICAOwnerCommented:
ok..

open ur Popup with

window.showModalDialog(url,arguments,features)

then u close this modaldialog u dont ave to refresh cuz it do refresh itself

0
 
Melih SARICAOwnerCommented:
when u use reload explorer acts as u hit F5 and try to send the data again  last time u do (clicking a link or button (.net control) ) ..

so u ll get that message.. try to relocate the url ..

btnClose.Attributes.Add("onClick", "window.opener.location.replace(location.href);window.close();")
0
 
GRCHELPDESKAuthor Commented:
Hi Non Zero,
Thanks for the feedback.  I tried your suggestion, but no joy.  The pop-up window seems to refresh but that's it.  For some reason, the popup doesn't even close.  Not sure why ... javascript is not my forte.
Thanks!

btnClose.Attributes.Add("onClick", "window.opener.location.replace(location.href);window.close();")

Open in new window

0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
Melih SARICAOwnerCommented:
try this...


  	
 
btnClose.Attributes.Add("onClick", "window.opener.location.replace(window.opener.location.href);window.close();")

Open in new window

0
 
GRCHELPDESKAuthor Commented:
That worked.  Except, it basically re-initializes the page.  So all of the users pre-selected values are lost.  I considered a querystring approach, but there are many pre-selected values.  And it would require a significant redesign at this point.
I basically need it to do the postback so it remembers the previous values, I just need to supress the refresh message and just do it.
I tried this code as it looked promising, but it doesn't seem to actually do the postback.  Any ideas are much appreciated!

btnClose.Attributes.Add("onClick", "window.opener.document.forms[0].submit();window.close();")

Open in new window

0
 
GRCHELPDESKAuthor Commented:
Looks great, thanks!  
I'll see if I can get the syntax right and let you know how it works out for me!  :-)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.