Refresh page with ASP command

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • emiel
    New Member
    • May 2006
    • 1

    Refresh page with ASP command

    I am making a form in an ASP page. One button will send the information, the other will reset the form. When the form is sent, all values are loaded into cookies, in case the form is incomplete and returned. When the reset button is clicked, the cookies, where the values of the form are stored, will be emptied and the page should be reloaded. How do I reload the ASP page with an ASP command?
  • sashi
    Recognized Expert Top Contributor
    • Jun 2006
    • 1749

    #2
    hi there,

    to reload a page after a preset delay..
    Code:
    <META HTTP-EQUIV="refresh" CONTENT="15">
    to redirect the page to another page after a preset time
    Code:
    <META HTTP-EQUIV="refresh" CONTENT="5; URL=http://www.somedomain.com/somepage.html">
    to reload a page with java script - link
    Code:
    <A HREF="javascript:history.go(0)">Click to refresh the page</A>
    to reload a page with java script - button
    Code:
    <FORM>
    <INPUT TYPE="button" onClick="history.go(0)" VALUE="Refresh">
    </FORM>
    good luck my fren..

    Comment

    • anndr0id
      New Member
      • Jul 2006
      • 3

      #3
      You could do

      Response.AddHea der "Refresh", "1"

      or I've also used

      Response.Redire ct("pagename.as p")

      just redirecting it to the same page, thats the only way I know to do it immediately.

      Comment

      • serj
        New Member
        • Nov 2006
        • 1

        #4
        Have some solution:
        <script type="text/javascript">
        function setr()
        {DelCookie("_pa geRefresh_");do cument.cookie = "_pageRefresh_= 1;path=/;";}

        function DelCookie(sName )
        {document.cooki e = sName + "=; expires=Fri, 31 Dec 1980 23:59:59 GMT;";}

        function CheckRefresh()
        { var aCookie = document.cookie .split("; ");
        for(var i=0;i<aCookie.l ength;i++){
        var aCrumb = aCookie[i].split("=");
        if (aCrumb[0]=="_pageRefresh _")
        {DelCookie("_pa geRefresh_");wi ndow.location.r eload(true);bre ak;}
        }
        }
        CheckRefresh();
        </script>

        <a href="javascrip t:setr();histor y.go(-1);" style="padding-right:5px" title="Go Back"><img src="../images/back.gif" alt="Go Back" border="0"></a>

        Comment

        • chrisjob012
          New Member
          • Nov 2006
          • 4

          #5
          excuse me guys......
          im new to this... so please clear my doubt... cant we do this using viewstate??...

          Comment

          Working...