Wrox Programmer Forums
|
ASP Pro Code Clinic As of Oct 5, 2005, this forum is now locked. No posts have been deleted. Please use "Classic ASP Professional" at: http://p2p.wrox.com/forum.asp?FORUM_ID=56 for discussions similar to the old ASP Pro Code Clinic or one of the other many remaining ASP and ASP.NET forums here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Pro Code Clinic section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 7th, 2005, 10:51 AM
Registered User
 
Join Date: Feb 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default showModalDialog then refresh problem

I have an asp.net page that is using the showModalDialog to alow the user to edit data from that page. If the user changes and saves the data in a dialog I want to refresh the parent window to reflect the changes made. All works well except for the darn:
"Page cannot be refreshed without resending the information"
message I get when the dialog closes and I attempt to refresh the parent.

Here is my code...

Parent Window:
Has a hyperlink with a URL of "javascript: showDialog(parms);"

<script language='JavaScript'>
showDialog{
...
var str = window.showModalDialog(url, parms, options);
if str='Refresh'
   window.location.reload(true);
</script>

The child window has a some script that is run when the "Save" button is pressed which tells the parent refresh:
<script language="javascript">window.returnValue="Refresh" ; window.close();</script>

I have seen this work before without getting that message but I must be missing a setting some place. Does anyone have any idea how to prevent the ""Page cannot be refreshed..." message?

Thanks!
-Dave
 
Old February 8th, 2005, 02:38 AM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

This is a classic ASP forum

Wind is your friend
Matt
 
Old February 18th, 2005, 11:46 AM
Registered User
 
Join Date: Feb 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

This should work....



<script language='JavaScript'>
showDialog{
...
var str = window.showModalDialog(url, parms, options);
if str='Refresh'
   window.location.href = unescape(window.location.pathname);
</script>


make sure if your url popup page is a webform to set <base TARGET="_self"> in the header section or your going to have problems with postbacks opening another window.






Similar Threads
Thread Thread Starter Forum Replies Last Post
showModalDialog Problem akhilesh_g Javascript 0 July 14th, 2008 06:43 AM
Problem with using showModalDialog savoym Javascript How-To 1 May 3rd, 2007 04:30 PM
Still the "Refresh problem" ... fskilnik Dreamweaver (all versions) 10 October 20th, 2005 11:25 AM
Refresh Problem gkirk Beginning PHP 2 February 25th, 2005 04:14 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.