mookie0001
Technical User
Hello,
I am having problems with a switch/case function. For some reason the function always returns only the default value. Yet, curiously, if I was to do an IF(Request.QueryString("page"=="home" type statement in place of the switch, the IF statement functions correctly. My code is below. Any ideas on what I am doing wrong? Thanks in advance!
-Chris
switch(Request.QueryString("page")
{
case "home" : {contentPage = "home.htm"; break}
case "programs" : {contentPage = "programs.htm"; break}
case "membership" : {contentPage = "membership.htm"; break}
case "notices" : {contentPage = "notices.htm"; break}
case "minutes" : {contentPage = "minutes.htm"; break}
case "links" : {contentPage = "links.htm"; break}
case "calendar" : {contentPage = "calendar.htm"; break}
case "newsletter" : {contentPage = "newsletter.htm"; break}
default : {contentPage = "home.htm"; break}
};
I am having problems with a switch/case function. For some reason the function always returns only the default value. Yet, curiously, if I was to do an IF(Request.QueryString("page"=="home" type statement in place of the switch, the IF statement functions correctly. My code is below. Any ideas on what I am doing wrong? Thanks in advance!
-Chris
switch(Request.QueryString("page")
{
case "home" : {contentPage = "home.htm"; break}
case "programs" : {contentPage = "programs.htm"; break}
case "membership" : {contentPage = "membership.htm"; break}
case "notices" : {contentPage = "notices.htm"; break}
case "minutes" : {contentPage = "minutes.htm"; break}
case "links" : {contentPage = "links.htm"; break}
case "calendar" : {contentPage = "calendar.htm"; break}
case "newsletter" : {contentPage = "newsletter.htm"; break}
default : {contentPage = "home.htm"; break}
};