META REFRESH

G

Guest

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()).ToString)
Response.Flush()
Response.Close()
End Sub
 
G

Guest

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?
 
A

addup

because your meta / refresh tag was never sent to the browser
Response.ClearContent()
Response.ClearHeaders()
Response.ContentType = "application/pdf"
Response.WriteFile(Server.MapPath(getPDFName()).ToString)
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 --
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top