Print Page | Close Window

Date-ASP

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=1385
Printed Date: 29 March 2026 at 2:53pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Date-ASP
Posted By: eagle00789
Subject: Date-ASP
Date Posted: 26 March 2003 at 4:11pm

Is it possible to create a asp page that, based on the current month, redirects to another page?

There also has to be the possibility to select the page thru a
?MonthID=4 for April or ?MonthID=7 for July

if so, please post the code for the page here or mail it to me at mailto:chris.simon@home.nl?subject=Date-Asp - chris.simon@home.nl?subject=Date-Asp

greetings chris

 



-------------
Using forum at http://www.gravenrode.nl/forum/forum - Gravenrode and http://www.gravenrode.nl/forum/test_forum - here and http://217.121.39.22/forum/test_forum - here



Replies:
Posted By: michael
Date Posted: 26 March 2003 at 4:56pm

<%
If Request.QueryString("MonthID") > 0 THEN
Select CASE Request.QueryString("MonthID")
CASE 1
Response.Redirect("wherever/january.asp")
CASE 2
Response.Redirect("wherever/february.asp")
.....
END SELECT
ELSE
Select CASE Month(Now())
CASE 1
Response.Redirect("wherever/january.asp")
CASE 2
Response.Redirect("wherever/february.asp")
.....
END SELECT
END IF
%>
That is just in a nutshell, sure to make better.



Posted By: eagle00789
Date Posted: 27 March 2003 at 12:04am

thx. this is what i needed

greetings chris



-------------
Using forum at http://www.gravenrode.nl/forum/forum - Gravenrode and http://www.gravenrode.nl/forum/test_forum - here and http://217.121.39.22/forum/test_forum - here


Posted By: eagle00789
Date Posted: 27 March 2003 at 8:40am

why does this doesn't work:

<%
If Request.QueryString("MonthID") > 0 THEN
Select CASE Request.QueryString("MonthID")
CASE 1
Response.Write("<!--#include file=""januari.htm"" -->")
.....
end select
end if
%>



-------------
Using forum at http://www.gravenrode.nl/forum/forum - Gravenrode and http://www.gravenrode.nl/forum/test_forum - here and http://217.121.39.22/forum/test_forum - here


Posted By: michael
Date Posted: 27 March 2003 at 10:09am
Well if you used the code as is, of course it does not work, it didi not feel like completing it, you need to repeat the cases for all month' in a year and don't use .......  if it is something else give an error message...........

-------------
http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker


Posted By: eagle00789
Date Posted: 27 March 2003 at 2:23pm

i completed it of course but i need:
Response.Write("<!--#include file=""januari.htm"" -->")
to work, but it doesn't



-------------
Using forum at http://www.gravenrode.nl/forum/forum - Gravenrode and http://www.gravenrode.nl/forum/test_forum - here and http://217.121.39.22/forum/test_forum - here


Posted By: michael
Date Posted: 27 March 2003 at 3:06pm

I know it doesen't. Includes are processed before asp, cannot use them dynamically. Use Server Transfer like
CASE 3
Server.Transfer "january.htm"

but variables from page a cannont be used on page b. There are unf. lot's of limitations with that in asp....



-------------
http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker


Posted By: eagle00789
Date Posted: 27 March 2003 at 3:28pm

i don't have any variables that has to transfer between sites

this works just like i wanted it to work.

Thanks



-------------
Using forum at http://www.gravenrode.nl/forum/forum - Gravenrode and http://www.gravenrode.nl/forum/test_forum - here and http://217.121.39.22/forum/test_forum - here



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net