...

View Full Version : Refresh/reload a page by clicking a button in another page



sujith
01-19-2007, 09:17 AM
ASP2.0

I am having following code in my parent.aspx

When one click on the LinkButton controll goes to child.aspx

Workes fine J.



<asp:LinkButton ID="lnkBtnAdd" runat="server" OnClientClick="OpenPopUp();">Add</asp:LinkButton><br />

And OpenPopUp() is as follws

function OpenPopUp()

{

window.open('child.aspx',null,'scrollbars=1,width=600,HEIGHT=400');

}



But really I am adding some products to a grid View in parent.aspx.

So when one press a button in child.aspx

I want the parent.aspx to be refreshed.
(such that all added products [in child] shuld show on parent)



How can I do that.



In short:I want to refresh/reload a page by clicking a button in another page



Hope u can help me



sujith

otaku149
01-19-2007, 12:15 PM
Add the following javascript into child.aspx


<script type="text/javascript">
function refreshOpener(){
if(opener && !opener.closed){
opener.location.reload();
}
}
</script>

In your child.aspx, add the refreshOpener javascript function using OnClientClick to the button that will refresh parent.aspx


<asp:Button ID="bt" runat="server" Text="GO!" OnClientClick="refreshOpener()" />



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum