back up codes

always have a backup of your code

Archive for the tag “page refresh”

page refresh using timeout

The following code uses Session.Timeout to refresh the page after a specified time.


Response.AppendHeader("Refresh", Convert.ToString((Session.Timeout * 60) + 10) & "; URL=myurl.aspx")

The next one uses javascript and the setTimeout property.


Body.Attributes.Add("onLoad", "window.setTimeout(""window.location.href='myurl.aspx'"",3000);")

refresh the page

The following code would refresh the page after 3 seconds.


Page.Response.AppendHeader("Refresh", "3; url=myurl.aspx")

It can also be written this way:


Dim myMeta As New HtmlMeta
myMeta.Name = "Refresh"
myMeta.Content = "3"
Me.Page.Header.Controls.Add(myMeta)

Post Navigation

Follow

Get every new post delivered to your Inbox.