Understanding .NET Documentation

  • Thread starter Thread starter Jonathan Wood
  • Start date Start date
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
 
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.
 
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
 
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...
 
Back
Top