Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Getting a huge number of paramters from nowhere

1 view
Skip to first unread message

K Viltersten

unread,
May 2, 2008, 4:17:03 PM5/2/08
to
I discovered that when requested

http://localhost:52698/ws3/page.aspx

and issued a call

Response.Write(Request.Params.Count);

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

http://localhost:52698/ws3/page.aspx?key=some

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.QueryString?


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

bruce barker

unread,
May 2, 2008, 4:23:01 PM5/2/08
to
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

unread,
May 2, 2008, 6:41:40 PM5/2/08
to
> 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"?

Scott M.

unread,
May 2, 2008, 7:38:19 PM5/2/08
to

"K Viltersten" <tm...@viltersten.com> wrote in message
news:681iobF...@mid.individual.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

K Viltersten

unread,
May 3, 2008, 4:53:16 AM5/3/08
to
>>> 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!

Teemu Keiski

unread,
May 3, 2008, 9:01:29 AM5/3/08
to
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
http://blogs.aspadvice.com/joteke
http://teemukeiski.net


"K Viltersten" <tm...@viltersten.com> wrote in message

news:681a95F...@mid.individual.net...

0 new messages