Hi Alan,
"A.M" <IH*******@sapm123.com> wrote in message
news:%2***************@TK2MSFTNGP11.phx.gbl...
Hi,
I have a property in my class like this:
<snip> Can I send parameter to get/set methods? I am trying to do something like
this:
CurrentDisplayName(HttpContext) = "something";
or
variable = CurrentDisplayName(HttpContext)
Is that possible?
Thanks,
Alan
The short answer is "No". The longer answer is you can make it *look*
like that's what you are doing, but it's somewhat more involved. The
Page.Session property you reference in your property is an example of how it
can be done. The session property itself does not accept parameters, but the
HttpSessionState class that the property returns defines an "indexer". So,
if CurrentDisplayName returns an object that defines an indexer, you can use
syntax like this:
CurrentDisplayName[...] = "something"; // where "..." is the value of
the parameter passed to the indexer
or
variable = CurrentDisplayName[...];
Regards,
Daniel