473,407 Members | 2,315 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

select case not working

Hello all,

Have an issue where a redirect pushes data to a page with a select case
which then redirects to another page. Problem is the redirect isnt
working in 1 case. Code below:

strURL = ""

if i = 1 then
strURL = "redirect.aspx?page=APIQ&parcel=" & strParcel &
"&year=" & lbYear.text
elseif i > 1 then
strURL = "redirect.aspx?page=dockm&docket=" & tbSubDocket.text &
"&page=" & tbSubPage.text <====== PROBLEM STARTS HERE
end if

if strURL <> "" then
response.redirect(strURL)
end if
redirect.aspx code here:

select case request.QueryString("page")

case "stridx"
session("sname")= request.querystring("sname")

response.Redirect("stridx.aspx")

case "APIQ"
session("parcel") = request.QueryString("parcel")
session("year") = request.QueryString("year")

response.Redirect("APIQ.aspx")
case "pdssub"
session("map") = request.QueryString("rmap")
session("plat") = request.QueryString("rplat")

response.Redirect("pdssub.aspx")
case "dockm"
session("docket")= request.QueryString("docket")
session("page") = request.QueryString("page")

response.Redirect("asrdockm.aspx")
case else
response.Write("WHAT THE CRAP!!?!?!??!")

end select

the case statement i am having problems with is the dockm statement
code skips over it and goes to the else statement
all the other case statements work great

if i substitue dockm for APIQ in the URL string i get the same behavior

this works:
strURL = "redirect.aspx?page=APIQ&parcel=" & strParcel &
"&year=" & lbYear.text

this doesnt:
strURL = "redirect.aspx?page=dockm&docket=" & tbSubDocket.text &
"&page=" & tbSubPage.text

and modifying to this doesnt work either:
strURL = "redirect.aspx?page=APIQ&docket=" & tbSubDocket.text &
"&page=" & tbSubPage.text
(just changed page value to APIQ)

goes straight to else statement

Can anyone help with this?

Thanks in advance

Nov 19 '05 #1
3 3365
you have a lot of bugs:

1) case sensitive compares
2) failure to urlen encode data

strURL = ""

if i = 1 then
strURL = string.Format("redirect.aspx?page=APIQ&parcel={0}& year={1}",
HttpUtility.UrlEncode(strParcel),
HttpUtility.UrlEncode(lbYear.text))
elseif i > 1 then
strURL = string.Format("redirect.aspx?page=dockm&docket={0} &page={1}",
HttpUtility.UrlEncode(tbSubDocket.text),
HttpUtility.UrlEncode(tbSubPage.text))
end if
if strURL <> "" then
response.redirect(strURL)
end if

redirect.aspx code here:

select case request.QueryString("page").ToLower()
case "stridx"
session("sname")= request.querystring("sname")
response.Redirect("stridx.aspx")
case "apiq"
session("parcel") = request.QueryString("parcel")
session("year") = request.QueryString("year")
response.Redirect("APIQ.aspx")
case "pdssub"
session("map") = request.QueryString("rmap")
session("plat") = request.QueryString("rplat")
response.Redirect("pdssub.aspx")
case "dockm"
session("docket")= request.QueryString("docket")
session("page") = request.QueryString("page")
response.Redirect("asrdockm.aspx")
case else
response.Write("WHAT THE CRAP!!?!?!??!")
end select

<ma********@myrapidsys.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
Hello all,

Have an issue where a redirect pushes data to a page with a select case
which then redirects to another page. Problem is the redirect isnt
working in 1 case. Code below:

strURL = ""

if i = 1 then
strURL = "redirect.aspx?page=APIQ&parcel=" & strParcel &
"&year=" & lbYear.text
elseif i > 1 then
strURL = "redirect.aspx?page=dockm&docket=" & tbSubDocket.text &
"&page=" & tbSubPage.text <====== PROBLEM STARTS HERE
end if

if strURL <> "" then
response.redirect(strURL)
end if
redirect.aspx code here:

select case request.QueryString("page")

case "stridx"
session("sname")= request.querystring("sname")

response.Redirect("stridx.aspx")

case "APIQ"
session("parcel") = request.QueryString("parcel")
session("year") = request.QueryString("year")

response.Redirect("APIQ.aspx")
case "pdssub"
session("map") = request.QueryString("rmap")
session("plat") = request.QueryString("rplat")

response.Redirect("pdssub.aspx")
case "dockm"
session("docket")= request.QueryString("docket")
session("page") = request.QueryString("page")

response.Redirect("asrdockm.aspx")
case else
response.Write("WHAT THE CRAP!!?!?!??!")

end select

the case statement i am having problems with is the dockm statement
code skips over it and goes to the else statement
all the other case statements work great

if i substitue dockm for APIQ in the URL string i get the same behavior

this works:
strURL = "redirect.aspx?page=APIQ&parcel=" & strParcel &
"&year=" & lbYear.text

this doesnt:
strURL = "redirect.aspx?page=dockm&docket=" & tbSubDocket.text &
"&page=" & tbSubPage.text

and modifying to this doesnt work either:
strURL = "redirect.aspx?page=APIQ&docket=" & tbSubDocket.text &
"&page=" & tbSubPage.text
(just changed page value to APIQ)

goes straight to else statement

Can anyone help with this?

Thanks in advance

Nov 19 '05 #2
Hi,
it fails because you are using two variables of the same name "page" in the
querystring which creates an array with two values: QueryString("page")(0)
and QueryString("page")(1).
Rename the other "page" (this -> page=" & tbSubPage.text) to something else
and it will work.
Cheers

"ma********@myrapidsys.com" wrote:
Hello all,

Have an issue where a redirect pushes data to a page with a select case
which then redirects to another page. Problem is the redirect isnt
working in 1 case. Code below:

strURL = ""

if i = 1 then
strURL = "redirect.aspx?page=APIQ&parcel=" & strParcel &
"&year=" & lbYear.text
elseif i > 1 then
strURL = "redirect.aspx?page=dockm&docket=" & tbSubDocket.text &
"&page=" & tbSubPage.text <====== PROBLEM STARTS HERE
end if

if strURL <> "" then
response.redirect(strURL)
end if
redirect.aspx code here:

select case request.QueryString("page")

case "stridx"
session("sname")= request.querystring("sname")

response.Redirect("stridx.aspx")

case "APIQ"
session("parcel") = request.QueryString("parcel")
session("year") = request.QueryString("year")

response.Redirect("APIQ.aspx")
case "pdssub"
session("map") = request.QueryString("rmap")
session("plat") = request.QueryString("rplat")

response.Redirect("pdssub.aspx")
case "dockm"
session("docket")= request.QueryString("docket")
session("page") = request.QueryString("page")

response.Redirect("asrdockm.aspx")
case else
response.Write("WHAT THE CRAP!!?!?!??!")

end select

the case statement i am having problems with is the dockm statement
code skips over it and goes to the else statement
all the other case statements work great

if i substitue dockm for APIQ in the URL string i get the same behavior

this works:
strURL = "redirect.aspx?page=APIQ&parcel=" & strParcel &
"&year=" & lbYear.text

this doesnt:
strURL = "redirect.aspx?page=dockm&docket=" & tbSubDocket.text &
"&page=" & tbSubPage.text

and modifying to this doesnt work either:
strURL = "redirect.aspx?page=APIQ&docket=" & tbSubDocket.text &
"&page=" & tbSubPage.text
(just changed page value to APIQ)

goes straight to else statement

Can anyone help with this?

Thanks in advance

Nov 19 '05 #3
LOL thanks.... I just noticed that when I got in this morning!!

rookie mistake.

thanks for the help

Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
by: Newbie | last post by:
Dear friends, I am having a hard time understanding how to use a SELECT CASE in ASP. I have used it in VB but never in ASP scripting. Scenerio: I have 2 textboxes on a form that I have to...
9
by: Kevin | last post by:
Hi, I am getting a syntax error Microsoft VBScript compilation error '800a03ea' Syntax error On the code below. The error references the "End Select" line Can anyone help me with what I am...
3
by: Rob Meade | last post by:
Ok - I *think* this is only different in .net 2.0 - as I've not had any problems in the past, but then maybe I've not tried it... I have a value being read from an xml file where the value maybe...
2
by: gozzer101 | last post by:
Hello all. I have managed to get the select case statements working using the following code: Dim strwhichoption As String strwhichoption = ComboBox1 ComboBox1.AddItem ("Reina")...
12
imrosie
by: imrosie | last post by:
I have a listbox called 'paymnt' ; it has 2 values (check & creditcard). Just below paymnt, I have a command button called 'sendpay' . I am trying to use a Select statement in 'sendpay' based on the...
3
by: CEO123 | last post by:
Does anyone know if it is possible and the syntax to test mutlitple expressions in a select case statement? This is the best I could come up with but it doesn't appear to be working Example: ...
25
by: LBinGA | last post by:
Hello all: I'm having trouble with a nested If Statement working properly. I'm working in MS Access 2002 (OS Windows XP, ver 2002). The non-working code is going on the Form (a Single) as follows:...
43
by: Mac rod | last post by:
Hi everyone, could you please help me. i have a combo box that have the values "1st month", "2nd month" etc, a text box to put details such as weight, length and ccirc. what i want to do is when a...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.