CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2005
    Location
    JHB South Africa
    Posts
    3,772

    [RESOLVED] meta http-equiv="Refresh" Problems..

    So i have a Dynamic page that the url is not positivly known before hand (Dot Net Nuke Module) so nothing can be hardcoded into the ASPX files.

    I found some code that allows the page to be refreshed every 60 seconds, Used to monitor who's online, that worked for my purpose..

    Code:
    <meta http-equiv='REFRESH' content='60; url=""'/>
    This code works perfectly in IE and FireFox, however i recently found out that in Chrome this code does not work..

    FF and IE understand this command to Refresh the current page however Chrome tries to load the page www.domain.com/folder/""

    For it to work in Chrome the code needs to be
    Code:
    <meta http-equiv='REFRESH' content='60'/>
    however IE and FF do nothing as no URL is specified, but Chrome is happy to refresh the current page.

    Ideally the code should contain the full page URL however the page is dynamic and can have a different URL depending on the DNN installation. Like

    http://www.domain1.com/Section/tabid...px?list=online

    http://www.domain2.com/page/tabid/87...px?list=online

    Thing is in the code i can and do build this url (to call the page), but have no method to inject it into the meta tag..
    Last edited by GremlinSA; June 27th, 2012 at 11:50 AM.
    Articles VB6 : Break the 2G limit - Animation 1, 2 VB.NET : 2005/8 : Moving Images , Animation 1 , 2 , 3 , User Controls
    WPF Articles : 3D Animation 1 , 2 , 3
    Code snips: VB6 Hex Edit, IP Chat, Copy Prot., Crop, Zoom : .NET IP Chat (V4), Adv. ContextMenus, click Hotspot, Scroll Controls
    Find me in ASP.NET., VB6., VB.NET , Writing Articles, My Genealogy, Forum
    All VS.NET: posts refer to VS.NET 2008 (Pro) unless otherwise stated.

  2. #2
    Join Date
    Jun 2005
    Location
    JHB South Africa
    Posts
    3,772

    Re: meta http-equiv="Refresh" Problems..

    Was working on this problem for a update this weekend and came across a solution, That ironically i had the code for all the time..

    so for the help of others.. (VB Code)
    Code:
        Dim oScript As HtmlMeta
        oScript = New HtmlMeta
        oScript.Attributes.Add("http-equiv", "REFRESH")
        oScript.Attributes.Add("content", "60; url='" & SiteString & TmpString & "Default.aspx?list=online'")
        Page.Header.Controls.Add(oScript)
    Also easy for C# ....
    Articles VB6 : Break the 2G limit - Animation 1, 2 VB.NET : 2005/8 : Moving Images , Animation 1 , 2 , 3 , User Controls
    WPF Articles : 3D Animation 1 , 2 , 3
    Code snips: VB6 Hex Edit, IP Chat, Copy Prot., Crop, Zoom : .NET IP Chat (V4), Adv. ContextMenus, click Hotspot, Scroll Controls
    Find me in ASP.NET., VB6., VB.NET , Writing Articles, My Genealogy, Forum
    All VS.NET: posts refer to VS.NET 2008 (Pro) unless otherwise stated.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured