Question

This is my first Page Name: RiskQuery.aspx. From this page on Click the Link button of Grid View , open another page name, RiskMessage.aspx. Both pages are under same master Page.

1st Page's Grid View Link button tag below:

 <asp:HyperLinkField DataNavigateUrlFields="AppID" DataNavigateUrlFormatString="~\RiskMessage.aspx?AppID={0}" Text="Message" target="_blank" />

code behind of my RiskMessage.aspx:

if (!IsPostBack)
{
    string id = null;
    try
    {
        id = Session["cust_id"].ToString();
    }
    catch { }

    if (id != null)
    {
        txtEntryHomeID.Text = id;
    }
    getMasterInfo();
}

I successfully opened the 2nd Page and from this page, I update my required record. But I want to Close the 2nd page after I update the record on the [Save] button press.

I need help closing the 2nd page.

Was it helpful?

Solution 2

if suppose your page was popup u can close by using window.close()

here u can use instead of

Page.ClientScript.RegisterStartupScript

ClientScript.RegisterClientScriptBlock

otherwise go back one step of your history by using JavaScript

end of your saving code if it is popup

ClientScript.RegisterClientScriptBlock(Page.GetType(), "script", "window.close();", true);

OTHER TIPS

Add this line of code on Save button press:

Page.ClientScript.RegisterStartupScript(this.GetType(), "close", "<script language=javascript>self.close();</script>");
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top