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. General Programming
  3. C#
  4. Request.QueryString Question.

Request.QueryString Question.

Scheduled Pinned Locked Moved C#
questiondatabasehelp
3 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.
  • J Offline
    J Offline
    Jacob D Dixon
    wrote on last edited by
    #1

    This isn't really something I need help on, but more wondering why or which way is better from asking experienced programmers. Request.QueryString["..."]; or Request.QueryString.Get("...."); Is there a reason for both of them? Does using the .Get save it time from not having to realize it needs to "Get" the query string? Just a silly question that has been bugging me so I've decided to ask.

    G 1 Reply Last reply
    0
    • J Jacob D Dixon

      This isn't really something I need help on, but more wondering why or which way is better from asking experienced programmers. Request.QueryString["..."]; or Request.QueryString.Get("...."); Is there a reason for both of them? Does using the .Get save it time from not having to realize it needs to "Get" the query string? Just a silly question that has been bugging me so I've decided to ask.

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      There is no difference. The Item property get method (that you use in the first case) just calls the Get method. The reason that both exists is probably to support programming languages that can not use an indexer (the first alternative). Another alternative to get the values is the GetValues method, and that one is different. It returns the values as a string array instead of concatenating them together as a comma separated list.

      Despite everything, the person most likely to be fooling you next is yourself.

      J 1 Reply Last reply
      0
      • G Guffa

        There is no difference. The Item property get method (that you use in the first case) just calls the Get method. The reason that both exists is probably to support programming languages that can not use an indexer (the first alternative). Another alternative to get the values is the GetValues method, and that one is different. It returns the values as a string array instead of concatenating them together as a comma separated list.

        Despite everything, the person most likely to be fooling you next is yourself.

        J Offline
        J Offline
        Jacob D Dixon
        wrote on last edited by
        #3

        Excellent. Thank you. Just something I've been wondering about. Thanks again!

        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