digitalZo
asked on
Iframe close on submit data and refresh parent
I have an Iframe which contains a form. After the user clicks on the submits button, the data should go to the database [i have done this] and the iframe should close automatically and refresh the parent page.
Is there any way I can do this on server side?
The problem wiht the following code is that the user has to double click in order for the form to close. Also, the parent page doesnt refresh.
Is there any way I can do this on server side?
The problem wiht the following code is that the user has to double click in order for the form to close. Also, the parent page doesnt refresh.
Protected Sub submit_btn_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles submit_btn.Click
//database queries.
submit_btn.Attributes.Add("OnClick", "javascript:closeiframe();return false;")
End Sub
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
where do i put this: window.opener.location.rel oad()?
also, i tried body unload...it didnt work..the parent page didnt refresh. secondly, i have to click on submit button twice to make the form close. how do i close it on first click?
also, i tried body unload...it didnt work..the parent page didnt refresh. secondly, i have to click on submit button twice to make the form close. how do i close it on first click?
can you post your code here?
ASKER
ok i added this in form tag and it worked:
<form id="form1" runat="server" onsubmit="parent.location. reload();" >
the only problem it's showing is that if the form is not yet filled then the page reloads with the new data in the dropdown without any hitches....but if there's data on the parent page, then on refresh, either the data stays intact but the new data does not get inserted in the dropdown OR the data disappears.
any idea why this is happening? and solution?
thanks for all your help. appreciated. :)
<form id="form1" runat="server" onsubmit="parent.location.
the only problem it's showing is that if the form is not yet filled then the page reloads with the new data in the dropdown without any hitches....but if there's data on the parent page, then on refresh, either the data stays intact but the new data does not get inserted in the dropdown OR the data disappears.
any idea why this is happening? and solution?
thanks for all your help. appreciated. :)
ASKER
Your solution did not help me, but I'd still give you points for attempting to answer.
Thanks, very supporative comment... you could have asked for question to be deleted, but once again Thanks,
Open in new window