Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Jul 2006
    Posts
    80
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Refresh/reload a page by clicking a button in another page

    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
    Last edited by sujith; 01-19-2007 at 09:20 AM.

  • #2
    Regular Coder
    Join Date
    May 2006
    Posts
    181
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Add the following javascript into child.aspx
    Code:
    <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
    Code:
    <asp:Button ID="bt" runat="server" Text="GO!" OnClientClick="refreshOpener()" />


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •