Getting a huge number of paramters from nowhere

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • K Viltersten

    Getting a huge number of paramters from nowhere

    I discovered that when requested



    and issued a call

    Response.Write( Request.Params. Count);

    i got 50 parameters in count. When i
    actually added some as in



    the number increased by two to 52. I'd
    be delighted if somebody enlighten me
    in this matter.

    1. Why is it an increase by two? Is it
    because the "key" and "some" are counted
    as separate paramters?

    2. Where in Gods love are the first
    fifty parameters?!

    3. Should i use Request.Params or is
    there something more recommended, e.g.
    Request.QuerySt ring?


    --
    Regards
    Konrad Viltersten
    --------------------------------
    sleep - a substitute for coffee for the poor
    ambition - lack of sense to be lazy

  • =?Utf-8?B?YnJ1Y2UgYmFya2Vy?=

    #2
    RE: Getting a huge number of paramters from nowhere

    well Request.Params is a combined collection of Server, Form, QueryString,
    Cookie and Server variables, so 50 is not a large count (most are server
    variables).

    you got 2 addition, because adding a querystring added the query string to
    the server variables collection, and the parsing the query string added a
    parameter to the querystring collecton.


    -- bruce (sqlwork.com)


    "K Viltersten" wrote:
    I discovered that when requested
    >

    >
    and issued a call
    >
    Response.Write( Request.Params. Count);
    >
    i got 50 parameters in count. When i
    actually added some as in
    >

    >
    the number increased by two to 52. I'd
    be delighted if somebody enlighten me
    in this matter.
    >
    1. Why is it an increase by two? Is it
    because the "key" and "some" are counted
    as separate paramters?
    >
    2. Where in Gods love are the first
    fifty parameters?!
    >
    3. Should i use Request.Params or is
    there something more recommended, e.g.
    Request.QuerySt ring?
    >
    >
    --
    Regards
    Konrad Viltersten
    --------------------------------
    sleep - a substitute for coffee for the poor
    ambition - lack of sense to be lazy
    >
    >

    Comment

    • K Viltersten

      #3
      SV: Getting a huge number of paramters from nowhere

      well Request.Params is a combined collection of Server,
      Form, QueryString, Cookie and Server variables, so 50 is
      not a large count (most are server variables).
      By that logic, i'd expect the parameters passed into the
      page using the exclamation mark to be at index 51 and
      52 but they seem to be at index 0 and 1. Comments?
      you got 2 addition, because adding a querystring added
      the query string to the server variables collection, and the
      parsing the query string added a parameter to the
      querystring collecton.
      Perhaps it's a matter of term confusion - is the part after
      the exclamation mark called "querry string"?


      --
      Regards
      Konrad Viltersten
      --------------------------------
      sleep - a substitute for coffee for the poor
      ambition - lack of sense to be lazy

      Comment

      • Scott M.

        #4
        Re: Getting a huge number of paramters from nowhere


        "K Viltersten" <tmp1@vilterste n.comwrote in message
        news:681iobF2qv tplU1@mid.indiv idual.net...
        >well Request.Params is a combined collection of Server, Form,
        >QueryString, Cookie and Server variables, so 50 is not a large count
        >(most are server variables).
        >
        By that logic, i'd expect the parameters passed into the
        page using the exclamation mark to be at index 51 and 52 but they seem to
        be at index 0 and 1. Comments?
        There's a difference between parameters "passed into the page" and
        parameters in general. Server variables are not passed via the URL. They
        are exchanged via request/response headers.
        >
        >you got 2 addition, because adding a querystring added the query string
        >to the server variables collection, and the parsing the query string
        >added a parameter to the querystring collecton.
        >
        Perhaps it's a matter of term confusion - is the part after
        the exclamation mark called "querry string"?
        Not the exclamation mark (!), the question mark (?). And yes, what comes
        after the question mark is the querystring, so you are seeing indexes
        referring to the querystring parameters.


        -Scott
        >
        >
        --
        Regards
        Konrad Viltersten
        --------------------------------
        sleep - a substitute for coffee for the poor
        ambition - lack of sense to be lazy
        >

        Comment

        • K Viltersten

          #5
          SV: Getting a huge number of paramters from nowhere

          >>well Request.Params is a combined collection
          >>of Server, Form, QueryString, Cookie and
          >>Server variables, so 50 is not a large count
          >>(most are server variables).
          >>
          >By that logic, i'd expect the parameters
          >passed into the page using the exclamation
          >mark to be at index 51 and 52 but they seem
          >to be at index 0 and 1. Comments?
          >
          There's a difference between parameters
          "passed into the page" and parameters in
          general. Server variables are not passed via
          the URL. They are exchanged via
          request/response headers.
          Right. Got it!
          >>you got 2 addition, because adding a
          >>querystring added the query string to the
          >>server variables collection, and the parsing
          >>the query string added a parameter to the
          >>querystring collecton.
          >>
          >Perhaps it's a matter of term confusion - is
          >the part after the exclamation mark called
          >"querry string"?
          >
          Not the exclamation mark (!), the question
          mark (?).
          Of course. Silly me...
          ...what comes after the question mark is the
          querystring, so you are seeing indexes
          referring to the querystring parameters.
          Thanks. It helped!

          --
          Regards
          Konrad Viltersten
          --------------------------------
          sleep - a substitute for coffee for the poor
          ambition - lack of sense to be lazy

          Comment

          • Teemu Keiski

            #6
            Re: Getting a huge number of paramters from nowhere

            In addition to what others have already said, by enabling page tracing (set
            Trace="true" to @Page directive), you can see what these parameters in
            different collections are.

            --
            Teemu Keiski
            AspInsider, ASP.NET MVP




            "K Viltersten" <tmp1@vilterste n.comwrote in message
            news:681a95F2pt gmuU1@mid.indiv idual.net...
            >I discovered that when requested

            >
            and issued a call
            >
            Response.Write( Request.Params. Count);
            >
            i got 50 parameters in count. When i actually added some as in
            >

            >
            the number increased by two to 52. I'd
            be delighted if somebody enlighten me
            in this matter.
            >
            1. Why is it an increase by two? Is it because the "key" and "some" are
            counted
            as separate paramters?
            >
            2. Where in Gods love are the first fifty parameters?!
            >
            3. Should i use Request.Params or is there something more recommended,
            e.g.
            Request.QuerySt ring?
            >
            >
            --
            Regards
            Konrad Viltersten
            --------------------------------
            sleep - a substitute for coffee for the poor
            ambition - lack of sense to be lazy
            >

            Comment

            Working...