Subscribe to Subscribers
Talk to Webmaster Tony John

Online Members

More...

Resources » Code Snippets » ASP.NET WebForms

How to Refresh page using asp.net


Posted Date:     Category: ASP.NET WebForms    
Author: Member Level: Gold    Points: 5


How to Refresh page using asp.net



 


How to Refresh page using asp.net?

<meta> tag is used to refresh a page continuously after a time interval.

The syntax of Meta tag is

 
<meta http-equiv="refresh" content="time interval"/>


We have to add two more attributes to above syntax
1)id
2)runat="server"
by which we can access this tag any where in code behind file.

For example :-
In Aspx file

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head id="Head1" runat="server">
<meta id="refreshRate" runat="server" http-equiv="refresh" content=""/>
<title></title>
</head>
<body>
<form id="form1" runat="server">
</form>
</body>

</html>



In code Behind File



Partial Class _Default
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
refreshRate.Content = "1"
End If

End Sub

End Class
Related Resources:


Read related articles: ASP.Net eventargs    Refresh page    Page life cycle    


Did you like this resource? Share it with your friends and show your love!


Responses to "How to Refresh page using asp.net"

No responses found. Be the first to respond...

Feedbacks      

Post Comment:




  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:   Sign In to fill automatically.
    Email: (Will not be published, but required to validate comment)



    Type the numbers and letters shown on the left.


    Next Resource: How to bind Gridview with array datasource
    Previous Resource: Upload and Compressed file
    Return to Resources
    Post New Resource
    Category: ASP.NET WebForms


    Post resources and earn money!
     
    More Resources
    Popular Tags   Tag posting guidelines   Search Tags  
    How to Refresh page using asp.net  .  
    Active Members
    TodayLast 7 Daysmore...

    Awards & Gifts
    Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India
    2005 - 2012 All Rights Reserved.
    .NET and other trademarks mentioned in this site belong to Microsoft and other respective trademark owners.
    Articles, tutorials and all other content offered here is for educational purpose only.
    We are not associated with Microsoft or its partners.