Understanding .NET Documentation

J

Jonathan Wood

Okay, I'll admit that I don't think a whole lot of some of the .NET
documentation. But it seems like I'm missing something here.

It has come to my attention that the Request property of a page supports the
subscript ([]) operator, and I'd like to understand what values this
returns. Request is of type HttpRequest and so I looked at the class members
at
http://msdn.microsoft.com/en-us/library/system.web.httprequest_members.aspx.

But I don't see any mention of the [] operator.

What am I missing?

Thanks.

Jonathan
 
H

Hillbilly

It would be best if you provided a reference to whatever source led you to
believe what you assert when it was brought to your attention as it
certainly sounds as if it was not the document you reference which brought
something to your attention you are now not able to reconcile with the
documentation.
 
J

Jonathan Wood

I got the idea that this was supported from Intellisense.

Jonathan

Hillbilly said:
It would be best if you provided a reference to whatever source led you to
believe what you assert when it was brought to your attention as it
certainly sounds as if it was not the document you reference which brought
something to your attention you are now not able to reconcile with the
documentation.

Jonathan Wood said:
Okay, I'll admit that I don't think a whole lot of some of the .NET
documentation. But it seems like I'm missing something here.

It has come to my attention that the Request property of a page supports
the subscript ([]) operator, and I'd like to understand what values this
returns. Request is of type HttpRequest and so I looked at the class
members at
http://msdn.microsoft.com/en-us/library/system.web.httprequest_members.aspx.

But I don't see any mention of the [] operator.

What am I missing?

Thanks.

Jonathan
 
G

Göran Andersson

Jonathan said:
Okay, I'll admit that I don't think a whole lot of some of the .NET
documentation. But it seems like I'm missing something here.

It has come to my attention that the Request property of a page supports
the subscript ([]) operator, and I'd like to understand what values this
returns. Request is of type HttpRequest and so I looked at the class
members at
http://msdn.microsoft.com/en-us/library/system.web.httprequest_members.aspx.


But I don't see any mention of the [] operator.

What am I missing?

Thanks.

Jonathan

Look at the Item property, that's the indexer.

http://msdn.microsoft.com/en-us/library/system.web.httprequest.item.aspx

My recommendtation is that you don't use the Request collection at all,
instead specify which collection (Cookies, ServerVariables, Form or
QueryString) that you want to look in.

If you read the values from the Request collection, and later somewhere
in your code adds a cookie with the same name as some form field or
querystring key, your code will break. You will most likely have a hard
time tracking down why some seamingly unrealted change in a completely
different part of the code suddenly makes a value disappear for some of
the users...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,145
Messages
2,570,824
Members
47,369
Latest member
FTMZ

Latest Threads

Top