Search code examples
vb.netmeta-tags

Form re-submitting in Edge browser


I have a simple form one button and a gridview. When the user clicks the button their name and the time they clicked is logged. I am using a meta tag to refresh the page every 30 seconds. It works fine in IE, Chrome, and Firefox but, on Edge browsers when it refreshes it gives the user a pop up to resubmit every time to resubmit and logs them again every time.

<meta http-equiv="refresh" content="30" />
    <form id="form1" runat="server">    
    <asp:Button ID="btnSave" runat="server" Text="Pick Up"/>
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False">
        <Columns>
            <asp:BoundField DataField="PLUSER" HeaderText="User" S 
             SortExpression="name" ItemStyle-Width="100px" />
            <asp:BoundField DataField="PLDATE" HeaderText="Date" 
             SortExpression="timeDate" ItemStyle-Width="250px" />
        </Columns>
    </asp:GridView>
    </form>

Is there a setting or something special about edge in relation to meta tags?


Solution

  • if someone else figures out why the meta tag fails in Edge...

    I've found a few reasons why the META tag doesn't work in Edge browsers.

    1. Security Settings:

    There is a security setting in internet explorer that does not allow meta tag refresh. It is under the Security tab, then choose Custom Level and the Meta Tag Refresh under Miscellaneous. If that is disabled, it would stop the meta refresh from working.

    1. It might need you to specify the URL in the Content:

      <meta http-equiv="refresh" content="30;URL=http://www.Stackoverflow.com">

    2. The META tag is not an empty tag and does not have a closing tag in HTML, only in XHTML.

    So HTML:

    <meta http-equiv="refresh" content="30">
    

    XHTML:

    <meta http-equiv="refresh" content="30"> </meta>
    

    Ref.


    I'm afraid even with all these potential solutions it still wont work in Edge. A good workaround is using progressive enhancement like you've done with the Script Manager, another method is using Javascript directly here: https://davidwalsh.name/meta-refresh-javascript

    <script>
        ESPN_refresh=window.setTimeout(function(){window.location.href=window.location.href},900000);
    </script>
    <noscript>
        <meta http-equiv="refresh" content="900" />
    </noscript>
    

    Use JavaScript as your primary means for automatic page refreshes and a META tag as your fallback.