Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. If...Then... Else based upon QueryString

If...Then... Else based upon QueryString

Scheduled Pinned Locked Moved Web Development
helpquestion
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sduffield
    wrote on last edited by
    #1

    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

    F 1 Reply Last reply
    0
    • S 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

      F Offline
      F Offline
      Fred_Smith
      wrote on last edited by
      #2

      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

      S 1 Reply Last reply
      0
      • F Fred_Smith

        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

        S Offline
        S Offline
        sduffield
        wrote on last edited by
        #3

        Thank you, Fred. I really appreciate your help! Actually, I am shocked that I was that close. sduffield

        F 1 Reply Last reply
        0
        • S sduffield

          Thank you, Fred. I really appreciate your help! Actually, I am shocked that I was that close. sduffield

          F Offline
          F Offline
          Fred_Smith
          wrote on last edited by
          #4

          :-D

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups