Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_web_howto thread: How can I make the page automatically refresh


Message #1 by "Enzo Zaragoza" <enzaux@g...> on Wed, 5 Dec 2001 20:52:46 +0800

This is a multi-part message in MIME format.



------=_NextPart_000_00DB_01C17DCE.CB3BBF70

Content-Type: text/plain;

	charset="iso-8859-1"

Content-Transfer-Encoding: quoted-printable



I have this ASP page which I will call list.asp that list all the Items 

in the recordset.  when i try to delete all of the items through 

remove.asp and goes back to list.asp still list.asp shows the items 

though I have remove them already.  I need to click the refresh button 

in order to see the deletion that I have made.  Why do you think its 

like that.  I have tried this in IE 5.5 and its running but in IE 5 it 

wont.  Would this be a browser issue?



please help.



Thanks,



Enzo






Message #2 by "Ken Schaefer" <ken@a...> on Thu, 6 Dec 2001 12:03:08 +1100
Expire the pages, or prevent the pages being cached in the first place.



Call SetHTTPHeaders()



Sub SetHTTPHeaders( _

    )



    Response.ExpiresAbsolute = #1/1/1980#

    Response.CacheControl = "private"

    Response.AddHeader "pragma", "no-cache"



End Sub





Cheers

Ken



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

From: "Enzo Zaragoza" <enzaux@g...>

Subject: [asp_web_howto] How can I make the page automatically refresh





I have this ASP page which I will call list.asp that list all the Items in

the recordset.  when i try to delete all of the items through remove.asp and

goes back to list.asp still list.asp shows the items though I have remove

them already.  I need to click the refresh button in order to see the

deletion that I have made.  Why do you think its like that.  I have tried

this in IE 5.5 and its running but in IE 5 it wont.  Would this be a browser

issue?





~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



Message #3 by "Sukhi" <sukhdeepsamra@h...> on Wed, 19 Dec 2001 22:07:48
Hi Enzo



did you figure out a solution for your problem?? if you can  psot the 

solution that would be great coz i have similiar problem regarding 

Refresh...



here is my problem...

I have two asp pages createuser.asp and edituser.asp



if user visit edituser.asp page it shows all the current user in the drop 

down box (which it gets from database)

Now if i createuser.asp and then in the same session i go to edituser.asp, 

in teh drop down box it doesn't show the newuser that i created. I have to 

click refresh to see the change.



I want to refresh the page only once when the page is opened. 



I used the follwoing code:

<head>

<script language="JavaScript">

var sURL = unescape(window.location.pathname);

function refresh()

{

    window.location.href = sURL;

}

</script>



</head>

<body bgcolor="#FFFFFF" onload="refresh()">



but this page keeps reloading the editpage every sec..wich is so annoying 

to the users eyes.......is there a way when i come to the edituser.asp 

page it refresh once as soon as it is opened?



is there a solution for this?...please let me know...



THANKS IN ADVANCE



> 

> This is a multi-part message in MIME format.

> 

> ------=_NextPart_000_00DB_01C17DCE.CB3BBF70

> Content-Type: text/plain;

> 	charset="iso-8859-1"

> Content-Transfer-Encoding: quoted-printable

> 

> I have this ASP page which I will call list.asp that list all the Items 

> in the recordset.  when i try to delete all of the items through 

> remove.asp and goes back to list.asp still list.asp shows the items 

> though I have remove them already.  I need to click the refresh button 

> in order to see the deletion that I have made.  Why do you think its 

> like that.  I have tried this in IE 5.5 and its running but in IE 5 it 

> wont.  Would this be a browser issue?

> 

> please help.

> 

> Thanks,

> 

> Enzo

> 

> ------=_NextPart_000_00DB_01C17DCE.CB3BBF70

> Content-Type: text/html;

> 	charset="iso-8859-1"

> Content-Transfer-Encoding: quoted-printable

> 

> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

> <HTML><HEAD>

> <META http-equiv=3DContent-Type content=3D"text/html; 

> charset=3Diso-8859-1">

> <META content=3D"MSHTML 5.50.4522.1800" name=3DGENERATOR>

> <STYLE></STYLE>

> </HEAD>

> <BODY bgColor=3D#ffffff>

> <DIV><FONT face=3DVerdana size=3D2>I have this ASP page which I will 

> call list.asp

> that list all the Items in the recordset.&nbsp; when i try to delete all 



> of the

> items through remove.asp and goes back to list.asp still list.asp shows 

> the

> items though I have remove them already.&nbsp; I need to click the 

> refresh

> button in order to see the deletion that I have made.&nbsp; Why do you 

> think its

> like that.&nbsp; I have tried this in IE 5.5 and its running but in IE 5 



> it

> wont.&nbsp; Would this be a browser issue?</FONT></DIV>

> <DIV><FONT face=3DVerdana size=3D2></FONT>&nbsp;</DIV>

> <DIV><FONT face=3DVerdana size=3D2>please help.</FONT></DIV>

> <DIV><FONT face=3DVerdana size=3D2></FONT>&nbsp;</DIV>

> <DIV><FONT face=3DVerdana size=3D2>Thanks,</FONT></DIV>

> <DIV><FONT face=3DVerdana size=3D2></FONT>&nbsp;</DIV>

> <DIV><FONT face=3DVerdana size=3D2>Enzo</FONT></DIV></BODY></HTML>

> 

> ------=_NextPart_000_00DB_01C17DCE.CB3BBF70--

> 

Message #4 by "Enzo Zaragoza" <enzaux@g...> on Thu, 20 Dec 2001 07:14:39 +0800

This is a multi-part message in MIME format.



------=_NextPart_000_027F_01C18925.FCFF9C90

Content-Type: text/plain;

	charset="iso-8859-1"

Content-Transfer-Encoding: quoted-printable



if you put your refresh onload it will definitely refresh again and 

again forever. try doing this ( this was an idea given by Clint Parsley 

to me in this forum and I think its great)



what you could do is

1.  use a clientside script to open edituser.asp in a new window.

2. edituser.asp does it work, closes when it's finished and refreshes 

the opening window as it closes.



small example:

edituser.asp



<%

 Dim strSql, objRS

 ' Delete the employee >from the Employee table

 strSql =3D "DELETE FROM Employee WHERE UserID=3D" & 

Request.QueryString("UserID")

 Set objRS =3D objConn.Execute(strSql)

 Set objRS =3D Nothing

%>

<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>

<head>

<title></title>

<script language=3D"javascript">

window.close(); // close window when it opens



function refreshMain(){

 window.opener.history.go(0); // refreshes opening window

}

</script>

</head>



<body onUnload=3D"refreshMain()">

</body>

</html>





I hope this would do coz I think it is a great idea.



Enzo :)





----- Original Message -----

  From: Sukhi

  To: ASP Web HowTo

  Sent: Wednesday, December 19, 2001 10:07 PM

  Subject: [asp_web_howto] Re: How can I make the page automatically 

refresh





  Hi Enzo



  did you figure out a solution for your problem?? if you can  psot the

  solution that would be great coz i have similiar problem regarding

  Refresh...



  here is my problem...

  I have two asp pages createuser.asp and edituser.asp



  if user visit edituser.asp page it shows all the current user in the 

drop

  down box (which it gets from database)

  Now if i createuser.asp and then in the same session i go to 

edituser.asp,

  in teh drop down box it doesn't show the newuser that i created. I 

have to

  click refresh to see the change.



  I want to refresh the page only once when the page is opened.



  I used the follwoing code:

  <head>

  <script language=3D"JavaScript">

  var sURL =3D unescape(window.location.pathname);

  function refresh()

  {

      window.location.href =3D sURL;

  }

  </script>



  </head>

  <body bgcolor=3D"#FFFFFF" onload=3D"refresh()">



  but this page keeps reloading the editpage every sec..wich is so 

annoying

  to the users eyes.......is there a way when i come to the edituser.asp 



  page it refresh once as soon as it is opened?



  is there a solution for this?...please let me know...



  THANKS IN ADVANCE



  >

  > This is a multi-part message in MIME format.

  >

  > ------=3D_NextPart_000_00DB_01C17DCE.CB3BBF70

  > Content-Type: text/plain;

  > charset=3D"iso-8859-1"

  > Content-Transfer-Encoding: quoted-printable

  >

  > I have this ASP page which I will call list.asp that list all the 

Items =3D

  > in the recordset.  when i try to delete all of the items through =3D

  > remove.asp and goes back to list.asp still list.asp shows the items 

=3D

  > though I have remove them already.  I need to click the refresh 

button =3D

  > in order to see the deletion that I have made.  Why do you think its 

=3D

  > like that.  I have tried this in IE 5.5 and its running but in IE 5 

it =3D

  > wont.  Would this be a browser issue?

  >

  > please help.

  >

  > Thanks,

  >

  > Enzo

  >

  > ------=3D_NextPart_000_00DB_01C17DCE.CB3BBF70

  > Content-Type: text/html;

  > charset=3D"iso-8859-1"

  > Content-Transfer-Encoding: quoted-printable

  >

  > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

  > <HTML><HEAD>

  > <META http-equiv=3D3DContent-Type content=3D3D"text/html; =3D

  > charset=3D3Diso-8859-1">

  > <META content=3D3D"MSHTML 5.50.4522.1800" name=3D3DGENERATOR>

  > <STYLE></STYLE>

  > </HEAD>

  > <BODY bgColor=3D3D#ffffff>

  > <DIV><FONT face=3D3DVerdana size=3D3D2>I have this ASP page which I 

will =3D

  > call list.asp=3D20

  > that list all the Items in the recordset.&nbsp; when i try to delete 

all

  =3D

  > of the=3D20

  > items through remove.asp and goes back to list.asp still list.asp 

shows =3D

  > the=3D20

  > items though I have remove them already.&nbsp; I need to click the 

=3D

  > refresh=3D20

  > button in order to see the deletion that I have made.&nbsp; Why do 

you =3D

  > think its=3D20

  > like that.&nbsp; I have tried this in IE 5.5 and its running but in 

IE 5

  =3D

  > it=3D20

  > wont.&nbsp; Would this be a browser issue?</FONT></DIV>

  > <DIV><FONT face=3D3DVerdana size=3D3D2></FONT>&nbsp;</DIV>

  > <DIV><FONT face=3D3DVerdana size=3D3D2>please help.</FONT></DIV>

  > <DIV><FONT face=3D3DVerdana size=3D3D2></FONT>&nbsp;</DIV>

  > <DIV><FONT face=3D3DVerdana size=3D3D2>Thanks,</FONT></DIV>

  > <DIV><FONT face=3D3DVerdana size=3D3D2></FONT>&nbsp;</DIV>

  > <DIV><FONT face=3D3DVerdana size=3D3D2>Enzo</FONT></DIV>

  ---<BR>

  Change your mail options at http://p2p.wrox.com/manager.asp or <BR>


$subst('Email.Unsub').

  </BODY></HTML>

  >

  > ------=3D_NextPart_000_00DB_01C17DCE.CB3BBF70--

  >









  Return to Index