If...Then... Else based upon QueryString
-
I am trying to display an image. Depending, though, on a test of the QueryString you'll get one of two images. This is what I've come up with so far.
<% if Request.QueryString("section") = "statebooks" then
Response.Write()
elseif Request.QueryString("section") = "directory" then
Response.Write()
else
Response.Write()
end if
%>Am I even close? Any help would be much appreciated. Thank you. sduffield
-
I am trying to display an image. Depending, though, on a test of the QueryString you'll get one of two images. This is what I've come up with so far.
<% if Request.QueryString("section") = "statebooks" then
Response.Write()
elseif Request.QueryString("section") = "directory" then
Response.Write()
else
Response.Write()
end if
%>Am I even close? Any help would be much appreciated. Thank you. sduffield
Close, but no cigar.... The Response.Write method needs a string (to write...), eg: Response.Write("Hello") So for starters you need to enclose what you want to write to the page in quote marks. To avoid the problem of your string including it's own quotes, you need to double them up - so you end up with: if Request.QueryString("section") = "statebooks" then Response.Write("") elseif Request.QueryString("section") = "directory" then Response.Write("") else Response.Write("") end if cheers Fred
-
Close, but no cigar.... The Response.Write method needs a string (to write...), eg: Response.Write("Hello") So for starters you need to enclose what you want to write to the page in quote marks. To avoid the problem of your string including it's own quotes, you need to double them up - so you end up with: if Request.QueryString("section") = "statebooks" then Response.Write("") elseif Request.QueryString("section") = "directory" then Response.Write("") else Response.Write("") end if cheers Fred
-
Thank you, Fred. I really appreciate your help! Actually, I am shocked that I was that close. sduffield
:-D