Congratulations to AcaCandy on her 100,000th post!
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
acer black screen blue screen boot bsod computer connection crash css dell display drive driver drivers email error ethernet excel firefox firefox 3 game hard drive internet internet explorer itunes laptop linux malware monitor network networking nvidia outlook outlook 2003 outlook 2007 outlook express partition problem router slow software sound trojan usb video virus vista windows windows xp wireless
Web Design & Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Internet & Networking > Web Design & Development >
Automated Date Update in ASP pages


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

Closed Thread
 
Thread Tools
stephanlh's Avatar
Junior Member with 5 posts.
 
Join Date: Jul 2005
06-Jul-2005, 03:52 PM #1
Automated Date Update in ASP pages
I am trying to find some code that I could use to make an asp page update automatically everytime it is changed. I have done this with the html pages using the code before the place for the date (in our case at the bottom of the page in the footer) <!-- #echo var="Last Modified"--> and because I live in Canada and we do not use the same date form as Americans, I also placed before the date (actually just after the header) the code <!--#config timefmt="%Y-%m-%d"--> so that the date will appear as year, month and day as it is suppose to be in all official documents in Canada. The only problem is this code only works in html and not on an asp page. I have tried moving the code near the header to the footer, but that does not seem to make any difference. I suppose that it was worth the try. Does anyone know of a solution which would be able to use code on the same asp page. I would like to avoid using an adjacent page or folder. Thank you for all suggestions...Stephan in Ottawa

Last edited by stephanlh : 07-Jul-2005 08:49 AM. Reason: Some inaccurate information
smeegle's Avatar
Distinguished Member with 3,430 posts.
 
Join Date: Jan 2004
Experience: Beginner
06-Jul-2005, 05:15 PM #2
There's a lot of discussion about ASP in the Web Development forum. If you don't get an answer here, click on the red triangle and ask one of the Mods to move your inquiry there.
stephanlh's Avatar
Junior Member with 5 posts.
 
Join Date: Jul 2005
07-Jul-2005, 08:54 AM #3
Thanks for the suggestion
Dear Mr. Smeegle,

Thanks for the suggestion. I suppose that I should have done that in the first place, but working in front of a computer screen on a daily basis seems to dull my use of simple logic. Best wishes...Stephan
Rockn's Avatar
Computer Specs
Distinguished Member with 17,888 posts.
 
Join Date: Jul 2001
Location: Mexico of the North, MN
Experience: Disenfranchised American Male
07-Jul-2005, 12:35 PM #4
Just write a function to format the date the way you want it.

<% Dim strDay, strMonth, strYear
Dim strEuroDte
strDay = DatePart("d", Date)
strMonth = DatePart("m", Date)
strYear = DatePart("yyyy", Date)
strEuroDte = strYear & "-" & strMonth & "-" & strDay

%>
<%= strEuroDte %>

You can call this from an include like you were doing as well.
stephanlh's Avatar
Junior Member with 5 posts.
 
Join Date: Jul 2005
07-Jul-2005, 03:49 PM #5
Thanks
Dear Rockn,

I can not quite get things to work. Do you mean this code right after the line Date modified as in:

Last updated:
<% Dim strDay, strMonth, strYear Dim strEuroDte
strDay=DatePart("d", Date) strMonth=DatePart("m", Date) strYear=DatePart("yyyy", Date) strEuroDate=strYear & "-" & strMonth & "-" strDay%>
<%=strEuroDate%>

For some reason I get the message that the page can not be displayed.
Thanks for all and every kind of help.

Stephan in Ottawa
Rockn's Avatar
Computer Specs
Distinguished Member with 17,888 posts.
 
Join Date: Jul 2001
Location: Mexico of the North, MN
Experience: Disenfranchised American Male
07-Jul-2005, 04:27 PM #6
Are you uploading it to your web host or trying to view it locally? If the page will not load your web host or test server doesn't support ASP.
stephanlh's Avatar
Junior Member with 5 posts.
 
Join Date: Jul 2005
08-Jul-2005, 08:44 AM #7
ASP on our server
Yes, we have other ASP pages on our server, in fact quite a few as it is a large server. The problem is more so that I could not get the code which I had initially used on the HTML pages to work on the ASP pages for the automated date update. The idea is that whenever someone makes a change the date is changed to the date on which the last change was made. It works perfectly with HTML <!-- #echo var="Last Modified"--> , but not with ASP. I will try your code again. I might be using it wrongly. I am trying to use it on the same page. May be I have to use it in a separate page and call it in which is not really what I want. The nice thing about the code <!-- #echo var="Last Modified"--> is that it can be placed on the very page concerned just after the words: Last Updated:

Thanks for your help and any suggestion...Stephan in Ottawa
Rockn's Avatar
Computer Specs
Distinguished Member with 17,888 posts.
 
Join Date: Jul 2001
Location: Mexico of the North, MN
Experience: Disenfranchised American Male
08-Jul-2005, 10:04 AM #8
I have a feeling that what you were running before was .Net and not standard HTML pages to call these variables. I would also assume that the current server does not have the .Net framework installed otherwise your original Echo to the variable would work.

BTW, have you recently moved from an Apache environment on a unix server?
__________________
**Disclaimer** Anything below this line ^ is part of my signature for those that may be confused

Sadly, there are no integers on this scale, so your gangly adolescent attempt to be clever has proved futile....Dieter

I have the right "NOT" to be tolerant of others because they are different, weird, or tick me off.....Parody of Andy Rooney

There are no stupid questions, but there are a LOT of inquisitive idiots.

Last edited by Rockn : 08-Jul-2005 11:19 AM.
stephanlh's Avatar
Junior Member with 5 posts.
 
Join Date: Jul 2005
08-Jul-2005, 11:30 AM #9
Thanks Rockn
I will have to contact the server people to ask these questions. You might be right. Thanks again...Stephan in Ottawa
Closed Thread

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who help people like you solve computer problems. See our Welcome Guide to get started.



Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 06:01 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.