Guruprasad J Rao
Guruprasad J Rao

Reputation: 29683

how to reload an aspx page within an iframe when click event triggers from the control within an iframe

I have a webpage wherein I have an iframe and I am loading a separate webpage [aspx] say wb2.aspx within it. There is a button named add comment in wb2.aspx. When the button is clicked a modal pop up will appear and it accepts some values and stores it in database. I am displaying the comments in wb2.aspx. Now my intention is soon after the comment is added the page must be refreshed and the newly entered comment must be visible. How can I do this?

Upvotes: 0

Views: 1388

Answers (1)

Guruprasad J Rao
Guruprasad J Rao

Reputation: 29683

After a long search I got this answer..

string script = "this.window.parent.location=this.window.parent.location;this.window.close();";
        if (!ClientScript.IsClientScriptBlockRegistered("REFRESH_PARENT"))
            ClientScript.RegisterClientScriptBlock(typeof(string), "REFRESH_PARENT", script, true);         

Upvotes: 2

Related Questions