) Asp.net code

Source: Internet
Author: User
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 ("

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.