1. when opening a page in a new window, we often need to open a new page when clicking a button. Due to application requirements, we cannot use a super connection or linkbutton to replace this button, therefore, we only need to open a new page in the button click event. I encapsulate this work into an API, as shown below: 1 opentracing winnewpage # region opentracing winnewpage 2 // open page 3 Public static void opentracing winnewpage (page curpage, string desturl) in a new window) 4 {5 string scriptstring = string. format ("
"); 26 if (! Page. isstartupscriptregistered (scriptname) 27 {28 page. registerstartupscript (scriptname, strscript. tostring (); 29} 30} 31 # endregion 3. another case is that when we close the current page, we need to refresh the "parent page" of the current page. The so-called "parent page" is a page before posting this page. You can call the following APIs: Region # region refreshfatherpage // refresh the father page public static void refreshfatherpage (httpresponse response, bool isclosecurpage) {stringbuilder scriptstring = new stringbuilder (); scriptstring ("
*/# Endregion 1. In Asp.net practical skills (1) I mentioned how to refresh the parent page. If I want to refresh the parent page of the parent page, what should I do? That is, refresh the ancestor page refreshancestorpage. Refreshancestorpage # region refreshancestorpage /**////
/// Refresh the specified ancestor page. Note: "ancestor page" // public static void refreshancestorpage (httpresponse response, string targetpagetitle, bool isclosecurpage) // targetpagetitle title {stringbuilder scriptstring = new stringbuilder (); scriptstring. append ("
*/# Endregion 2. How to refresh the page in a frame of the ancestor page? Refreshframeinancestorpage # region refreshframeinancestorpage /**////
/// Refresh the internal page of a framework in the specified ancestor page // public static void refreshframeinancestorpage (httpresponse response, string ancestortitle, string framename, string TargetUrl, bool isclosecurpage) // targetpagetitle title {stringbuilder scriptstring = new stringbuilder (); scriptstring. append ("