How to refresh an page
  • Automatic web page refresh can be implemented in an ASP.NET (.aspx page) web-page by adding some HTML coding in the header section.
    You can simply add following line of code in the Header section to enable auto refresh in an ASP.NET (aspx) web page.

    <meta http-equiv="refresh" content="15">

    Where 15 refers to the number of seconds it will take before refreshing the page.

    Also you can redirect to a specific page if you put the URL inside the tag.

    <meta http-equiv="refresh" content="15;url=">

    In reality, this is standard HTML functionality and nothing specific to ASP.NET. The same effect of auto-refresh would be seen whether it is an ASP.NET page or just a HTML page, or a page made in Java, PHP, ColdFusion, Perl or the like.
    If you want to set the refresh time dynamically then that can be done in ASP.NET by adding server side code in the Page_Load method to set it, as shown below:

    Response.AppendHeader("Refresh", "15")
  • 1 Comment sorted by
  • nice sharing @jaguar777

Howdy, Stranger!

It looks like you're new here. If you want to get involved, or you want to Ask a new Question, Please Login or Create a new Account by Clicking below

Login with Facebook


Popular Posts of the Week