I have a classic ASP page that reads the variables in the QueryString and uses a series of case statements to determine what content to display based on the Querystring variables. The case statements are very large and complex with nested case statements.
I need to convert this page to C# ASP.NET utilizing an object oriented approach. Does anyone have an idea as to the best way to do this. Below is an example of the old ASP page
<%
Dim phone, id, st, dir, atlas, version, pricepoint, va, spotlight
version = "nobundle"
phone = "1-877-460-2DSL"
id = Request.QueryString("id")
st = Request.QueryString("st")
dir = Request.QueryString("dir")
atlas = "VZB_VOL05_JDPOWER_HOME"
pricepoint = "39.99"
va = false
spotlight = "<script language=""JavaScript"" type=""text/javascript"">"
& vbCrLf &_
"var axel = Math.random()+"""";" & vbCrLf &_
"var a = axel * 10000000000000;" & vbCrLf &_
"</script>" & vbCrLf &_
"<noscript>" & vbCrLf &_
blah blah
"</noscript>" & vbCrLf
%>
<%if dir = "search" AND st = "overture" then %>
<!-- #include file = "inc/cpDisplay.asp" -->
<%end if%>
<%
Function WriteQS()
if st <> "" then
Response.write("st=" + st)
elseif id <> "" then
Response.write("id=" + id)
else
Response.write("id=0")
end If
end Function
SELECT CASE dir
'November 07 DM urls
CASE "29","29DM","29dm"
pricepoint = "29.99"
phone = "1-888-376-3435"
CASE "39","39DM","39dm"
pricepoint = "39.99"
phone = "1-888-376-3435"
'January 07
'Begin WV/VA variable
CASE "broadbandspeed"
pricepoint = "39.99"
phone = "888-229-7359"
version = "freedom"
va = true
SELECT CASE id
CASE 4,6,8,10,14,15,16,18,20,22
version = "veriations"
CASE 26,28,30,32,36,37,38,40,42
,44,48,54,
56,65,66,8
2,83
version = "veriations"
phone = "1-877-460-2DSL"
END SELECT
CASE "forbusiness", "gofast"
pricepoint = "39.99"
phone = "888-229-7359"
version = "freedom"
va = true
'End WV/VA variable
CASE "callanywhere", "businesstools", "businessinternet", "workonline", "businesssavings", "greatplan", "bundlesforbusiness", "businessconnections", "onlinesavings", "getonline", "businessplan", "getinternet", "officesavings", "bestchoice"
pricepoint = "39.99"
phone = "1-877-460-2DSL"
version = "freedom"
'November 06 urls
CASE "bizdsldeal"
pricepoint = "39.99"
phone = "1-877-460-2DSL"
version = "freedom"
SELECT CASE id
CASE 0,01,04,06,08,10,12,13,14,
17,19
pricepoint = "39.99"
version = "freedom"
CASE 02,03,05,07,09,11,18,20
pricepoint = "39.99"
version = "veriations"
CASE 15,20,21,22,23,24,25
pricepoint = "29.99"
version = "freedom"
CASE 16
pricepoint = "29.99"
version = "veriations"
END SELECT
CASE "reliabledsl"
pricepoint = "39.99"
phone = "1-877-460-2DSL"
SELECT CASE id
CASE 01,05,11
pricepoint = "29.99"
version = "freedom"
CASE 02,06,12
pricepoint = "29.99"
version = "veriations"
CASE 03,07,09,13,15
pricepoint = "39.99"
version = "freedom"
CASE 04,08,10,14,16
pricepoint = "39.99"
version = "veriations"
END SELECT
CASE "yourbusiness"
pricepoint = "39.99"
phone = "1-877-460-2DSL"
SELECT CASE id
CASE 01,04,06,21,23,26
pricepoint = "39.99"
version = "freedom"
CASE 03
pricepoint = "29.99"
version = "veriations"
CASE 02
pricepoint = "29.99"
version = "nobundle"
CASE 05,07,17,24,27,29
pricepoint = "39.99"
version = "veriations"
END SELECT
Start Free Trial