.NET FAQs Unleashed!
 
    
    

How to refresh a page in another page?

In the example below, after the user closes the child page, the parent page will be refreshed.

 

Parent page:  (use window.open to open the popup page)

 

<asp:Button ID="Button1" OnClientClick="javascript:window.open('Popup.aspx');" runat="server" Text="Button" />

 

Popup.aspx: (After clicking the Button1, it will submit the change and refresh the parent page.)

 

protected void Button1_Click(object sender, EventArgs e)

{

    if (IsChanged())//the user made a change

    {

        Page.ClientScript.RegisterStartupScript(this.GetType(), "refresh", " window.opener.location.reload(); ", true);

        Page.ClientScript.RegisterStartupScript(this.GetType(), "close", "window.close();", true);

    }

}

 

ASP.NET Expression Symbols   Web Service in ASP.NET   Pass data to Web Control   Zipping a folder in ASP.NET   Check user online or offline   Display Dynamic Tooltips   Dynamic Server Side Tables   Capture Gridview Row Index   Improve ASP.NET Performance   Refresh page in another page   Step into DLL Source Code   Insert Non-Ascii Characters in a Database   Contract in WCF   Dependency Injection   Asp.net triggering a Postback   Cyclomatic Complexity   ~ Character in ASP.NET   Web Application Project VS. Website Project   Optimistic Locking VS. Pessimistic Locking   System.Net.Mail VS. System.Web.Mail   Breakpoints in debugging  

More Interview Questions...