473,397 Members | 2,077 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

META REFRESH

HI,

Can someone explain to me why the
<meta http-equiv="refresh" content="5"/> will not work for me?

I use it in a standard asp page and it works just fine.
Why in ASP.NET2.0 it doesn't. I don't get any errors, it simply does not
trigger the page_load event after 5 seconds.

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

<!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 runat="server">
<title>test</title>
<meta http-equiv="refresh" content="5"/>
</head>
<body>
</body>
</html>

CODE

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Me.Load
Response.ClearContent()
Response.ClearHeaders()
Response.ContentType = "application/pdf"
Response.WriteFile(Server.MapPath(getPDFName()).To String)
Response.Flush()
Response.Close()
End Sub

Jan 30 '06 #1
2 1755
In fact, It works only if the page is updated with html but as not when the
output is a stream .... I guess I will have to write a callback function?
will it work or it is simply not possible when using stream?

"joeblast" wrote:
HI,

Can someone explain to me why the
<meta http-equiv="refresh" content="5"/> will not work for me?

I use it in a standard asp page and it works just fine.
Why in ASP.NET2.0 it doesn't. I don't get any errors, it simply does not
trigger the page_load event after 5 seconds.

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

<!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 runat="server">
<title>test</title>
<meta http-equiv="refresh" content="5"/>
</head>
<body>
</body>
</html>

CODE

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Me.Load
Response.ClearContent()
Response.ClearHeaders()
Response.ContentType = "application/pdf"
Response.WriteFile(Server.MapPath(getPDFName()).To String)
Response.Flush()
Response.Close()
End Sub


Jan 30 '06 #2
because your meta / refresh tag was never sent to the browser
Response.ClearContent()
Response.ClearHeaders()
Response.ContentType = "application/pdf"
Response.WriteFile(Server.MapPath(getPDFName()).To String)
Response.Flush()
Response.Close()


you sent the pdf file in your response, no meta tags

I'm not sure if it will work, but you can try to set refresh 5 in your
http header (AFTER your ClearHeaders, obviously)

g'luck
-- addup --

Jan 30 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

43
by: dan baker | last post by:
I have a page that gets loaded with a meta-refresh hardcoded so that a few things on the page get updated. its kind of a fake chat board. anyway, what I need to do is turn off the meta-refresh once...
14
by: Shiperton Henethe | last post by:
Hi Is there anyway to get a meta refresh to do so in an new browser window? e.g. This code forwards this user after 8 seconds... <meta http-equiv=refresh...
2
by: Jarson | last post by:
My webserver hosts some on-line reports with live data. I have put an html meta tag to force the client to refresh every 10 minutes so my clients will always show the latest data .. <meta...
4
by: Jim Hammond | last post by:
After much effort, it doesn't seem possible to redirect the user to a new page after 10 seconds by using a server-side timer. I am now using the following meta statement to accomplish the same...
1
by: Maziar Aflatoun | last post by:
Hi everyone, My goal is to modify the contents of my meta tag (html refresh). However, my code adds a new instance of the meta tag at the bottom of the page. Is there a way to modify it instead...
2
by: Prodip Saha | last post by:
I am sure there is an easy fix for this problem. I am reloading the same page at an interval using the meta refresh tag in aspx page. This page has one textbox and one button. The problem is -when...
4
by: Tim::.. | last post by:
Can someone please tell me why the following dynamic refresh doesn't work! Thanks Inline code... <!----- dynamically filled META REFRESH element -----> <meta id="mtaRefresh" runat="server" />...
3
by: dave | last post by:
I want to be able to have my webpage to continually refresh automatically every so many seconds. When it refreshes, I want it to refresh to the bottom of the screen. To accomplish this, I am...
2
by: =?Utf-8?B?UGhpbCBKb2huc29u?= | last post by:
Hello, I have an ASP.NET 2.0 application with the following meta tag to refresh the page after a minute. <meta http-equiv="Refresh" content="60; URL=Default.aspx" /> I need to be able to...
2
by: runway27 | last post by:
i have a registration page which is a self submitting form <form action="<?php echo $_SERVER; ?>" method="POST" id="test2" name="registrationform"> where in a user fill a form, after the data...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.