Link to home
Start Free TrialLog in
Avatar of ullenulle
ullenulleFlag for United States of America

asked on

Refresh parent page from iframe...

Hi.

I have this webdatabase made in classic asp/VBscript, and when a specific page is loaded into an iframe, I want to refresh the parent page after some SQL-codes has been executed. Why? Because the SQL update info on the parent page.
How can I do that built into the SQL precedure?? Is there a VBscript that can do the job? I know there's javascripts, but as far as I know I can't mix that up with the asp/VBscript.
I hope there's a solution out there. :-)

Best regards

Ulrich
Avatar of David Johnson, CD
David Johnson, CD
Flag of Canada image

an iframe is a separate independent page so it can't be done
SOLUTION
Avatar of HainKurt
HainKurt
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ullenulle

ASKER

Hi Huseyin.

I'm afraid that didn't work. The parent page didn't update. Does it matter where I place the script-tag? I placed the onload in the present body-tag.

Best regards

Ulrich
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi again, Huseyin.

That was an improvement. The parent refresh, but then the page I want to update inside the iframe is gone again. The refresh shouldn't happen until I updated/submitted the page inside the iframe. :-)
Any more alterations?

Best regards

Ulrich
looks like your parent also overwrites the iframe inside...

lemme think a bit :)

to find a solution without any infinite loop!
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi Huseyin.

Thank you for your post. I do use Jquery a little. I need a few hints though:

1) Can I place the javascript code anywhere on top of the page?
2) I need to include the jquery on the page, right? (it isn't right now)
3) How is your script launched? When the submit button is clicked?
4) #idForm: Am I supposed to paste my iframe name there?
5) Anything else I must substitute in your script with my own stuff?

Best regards

Ulrich
Oh... and I actually also need a variant of the code where I after posting data in the iframe page want to redirect to another page overall.
I usually use something like:

    Dim MM_editRedirectUrl
    MM_editRedirectUrl = "rlab_patientregi_edit.asp"
	MM_editRedirectFilter  = Request.Form("cprnr")
    If (Request.QueryString <> "") Then
      If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0) Then
        MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
      Else
        MM_editRedirectUrl = MM_editRedirectUrl & "?" & "cprnr=" & MM_editRedirectFilter
      End If
    End If
    Response.Redirect(MM_editRedirectUrl)

Open in new window


Can I sneak some _parent or something into that?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi Huseyin.

Thanks for your effort, but the  code didn't make any difference on my  page. I placed it on a seperate location in my codes and also together with another javascript funtion that I know works and are being launched. :-(
But after hours of searching I finally found something that worked out for me from stackoverflow:

Response.Write("<script type=text/javascript> window.parent.location.href ='http://yoursite.com' </script>")

Open in new window


And I just infused some querystrings to open up the desired page with desired filter. Problem solved. :-)

But thank you for your effort! I would still like to know why your script didn't launch. Any idea why? I want to learn as much as possible about javascripts.

Best regards

Ulrich
not sure what you used... any of them should work...
you used asp response.write to put it on page dynamically...

@ID: 42167223

if you try one of them as you did, they should work as well, but they refresh the page, do not change top url, which you asked for initially...
Thank you again. Will test your code in a response.write tag later.