Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Object Expected...Response.ExpiresAbsolue???

Status
Not open for further replies.

booboo0912

Programmer
Jul 31, 2002
75
US
Hello! I put the following at the top of my page (from what I was able to find in older treads, this was one recommendations to prevent caching problems), before the <html> tag:

<%
Response.Buffer = &quot;True&quot;
Response.Expires = 0
Response.ExpiresAbsolute = Now() - 1
Response.CacheControl = &quot;private&quot;
%>

but I'm getting the error, &quot;object expected&quot; on the Response.ExpiresAbsolute = Now() - 1 line.

Any idea why? I'm using Javascript instead of VB...could it be the &quot;Now()&quot; ??

Thanks in advance!!
 
try putting Now() in a string first.. www.vzio.com
ASP WEB DEVELOPMENT



 
i still get an object expected error, this time on the line i try to put it into a variable...am i missing something? could be b/c i'm a newbie, but it can't be this difficult! right? :~/
 
Gary is right, didn't see it.. you can't use both time and date.. www.vzio.com
ASP WEB DEVELOPMENT



 
What does an overflow error mean? I even put Date into a variable, and still get the overflow error. Any ideas?
Thanks for your help!
 
Try it this way

<% Response.ExpiresAbsolute = #January 1, 2002 13:30:18# %>
 
Thanks for responding Gary...but now I'm getting an invalid character error! Does this have anything to do with Javascript vs VBScript?
 
Try this. The actual Date function you want to use is actually Probably getDate();

You should be able to replace the now() function with the one listed above, and it should work without a problem

Response.ExpiresAbsolute = (getDate()-1);
This way it processes the getDate-1 first, then assigns it to the expires. The money's gone, the brain is shot.....but the liquor we still got.
 
I have <%@Language = &quot;Javascript&quot;%> on the first line of my page, then I have the following:

<%
Response.Buffer = 'True'
Response.Expires = 0
Response.ExpiresAbsolute = #January 1, 2002 13:30:18#
Response.CacheControl = &quot;private&quot;
%>

then my <html>, etc.


 
Put <%@Language = &quot;Javascript&quot;%> after the Response objects
 
Thank you both for your help, but still no success.

Gary: When I put the @ after the response objects, the error tells me the @ must be the first command within an asp page.

Dynapen: I put &quot;Response.ExpiresAbsolute = (getDate() - 1);&quot; and it still gives me an object expected error.

why doesn't it work for me?? [sadeyes]



 
Im going a bit outta my realm but
< Script Language = &quot;Javascript&quot; >
should be sufficient to declare the start of javascript
with a script closing tag at the end
 
Thanks to everyone for all your help...I think I might have to go about this in another way since nothing seems to want to work. Have a great week!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top