META REFRESH

Discussion in 'ASP .Net' started by =?Utf-8?B?am9lYmxhc3Q=?=, Jan 30, 2006.

  1. 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
     
    =?Utf-8?B?am9lYmxhc3Q=?=, Jan 30, 2006
    #1
    1. Advertising

  2. 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()).ToString)
    > Response.Flush()
    > Response.Close()
    > End Sub
    >
    >
    >
    >
    >
     
    =?Utf-8?B?am9lYmxhc3Q=?=, Jan 30, 2006
    #2
    1. Advertising

  3. =?Utf-8?B?am9lYmxhc3Q=?=

    addup Guest

    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 --
     
    addup, Jan 30, 2006
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jim Hammond

    server-side timer vs. meta refresh

    Jim Hammond, Oct 24, 2003, in forum: ASP .Net
    Replies:
    4
    Views:
    5,919
    mikeb
    Oct 27, 2003
  2. Nym Pseudo

    META NAME and META HTTP-EQUIV

    Nym Pseudo, Sep 26, 2003, in forum: HTML
    Replies:
    1
    Views:
    573
    =?iso-8859-1?Q?brucie?=
    Sep 26, 2003
  3. Duane Johnson

    Meta methods to govern meta data?

    Duane Johnson, Oct 25, 2005, in forum: Ruby
    Replies:
    6
    Views:
    250
    Adam Sanderson
    Oct 28, 2005
  4. Erik Veenstra

    Meta-Meta-Programming

    Erik Veenstra, Feb 7, 2006, in forum: Ruby
    Replies:
    29
    Views:
    412
    Erik Veenstra
    Feb 8, 2006
  5. Erik Veenstra

    Meta-Meta-Programming, revisited

    Erik Veenstra, Jul 21, 2006, in forum: Ruby
    Replies:
    21
    Views:
    460
    Erik Veenstra
    Jul 25, 2006
Loading...

Share This Page