Parse http querystring variables into a list collection RRS feed

  • Question

  • User1909155429 posted


    i return the above string to page and would like to parse the variables into a more convenient form for easy access.

    more appropriately, i would like to further parse on error(n). string variables and return each related substring and add to another list object. like such

    error(0), ({ errorId,category,severity,message})

    error(1),({ errorId,category,severity,message})



    Sunday, November 10, 2013 4:32 PM


  • User446859115 posted

    I'm not clear as to where you want to preform the parsing. Are you looking to preform this function at the client (anotherwords in javascript) or on the server? If on the server are you posting the data or using a GET? Do the names in the name-value-pair change from post to post or are they always the same list?

    In general I'd split the request string into an array of name-value-pairs (NVP) using the string method split which is available in Javascript, c# or VB. Then step through the resulting array building whatever datastructure you require. I usuall use the standard string parsing techniques centered around indexing off the equal sign.

    If you know before hand the NVP elements and are using a GET, and you're processing on the server side you can skip the string splitting step and just use the QueryString["element"] name format.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, November 11, 2013 1:21 PM