Asp. NET implementation of page Refresh method

Source: Internet
Author: User
Tags net window

< meta http-equiv= "Refresh" content= "300; Url=target.html "> Refresh another frames page with WINDOW.LOCATION.HREF implementation
In writing ASP.net program, we often encounter the problem of the jump page, we often use Response.Redirect, if the customer wants to jump in the use of tips, this is not a good idea, such as:
Response.Write ("< Script>alert" ("Congratulations, registration success!") '); </script> "); Response.Redirect ("main.html"); At this time our prompt content did not come out on the jump, and Response.Redirect ("main.html"); without any distinction.
Then we use the following code to test the ASP.net page refresh:
Response.Write ("< script Language=javascript>alert" (' Congratulations, registration success!) ') </script> "); Response.Write ("< script language=javascript>window.location.href= ' main.html ' </script>"); This is the realization of our requirements, in the prompt after the jump page.
The most important thing is that the WINDOW.LOCATION.HREF statement can implement a frame of the page after executing the server-side code to refresh another frame of the page (Response.Redirect cannot be reached, at least I did not find):
For example, there are two frames in the index.htm page, Frameleft and Frameright, which refresh the page in the Frameleft after the server-side code is executed on the Frameright page.
Before the most common is registered, automatically refresh the landing box, so that the landing box into the landing page, as long as the registration of successful code after the addition of a paragraph, that can be implemented to refresh another frame of the page. The code is as follows:
Response.Write ("< script Language=javascript>alert" (' Congratulations, registration success!) ') </script> "); Response.Write ("< script language=javascript>window.parent.frameleft.location.href= ' main.html ' </script > "); Asp. NET page refresh: Automatic refresh of the page implementation method Summary:
1)
< meta http-equiv= "Refresh" content= "10; Url= jump Page "> 10 indicates a refresh interval of 10 seconds
2)
< script language= ' JavaScript ' > Window.location.reload (TRUE); </script> If you want to refresh an iframe, replace the window with the name or ID number of the frame.
3)
< script language= ' JavaScript ' > Window.navigate ("This page URL"); </script> 4>
Function abc () {window.location.href= "/blog/window.location.href"; settimeout ("ABC ()", 10000);} Refresh this page:
Response.Write ("< script language=javascript>window.location.href=window.location.href; </script> ") Refresh parent page:
Response.Write ("< script language=javascript>opener.location.href=opener.location.href; </script> ") go to the specified page:
Response.Write ("< script language=javascript>window.location.href= ' yourpage.aspx"; </script> ")
Refresh page Implementation Summary (HTML,ASP,JS)
' By Aloxy
Timed refresh:
1,
< Script>settimeout ("location.href= ' url" ",") </script> Description: URL is the page URL address to refresh
2000 is the wait time = 2 seconds,
2,
< meta name= "Refresh" content= "N; URL "> Description:
n is the number of seconds to wait before loading the specified URL.
URL is a absolute URL to be loaded.
N, is the time to wait, in seconds
URL is the URL address of the page to be refreshed
3,

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.