Assume that we're using Inproc session, then all the variables held in
session state are in-memory objects. So whether we can directly modify the
object without reassign it back to the sessionstate entry depend on its
class type. If it's of reference type, the session state entry just hold
the reference to that object, so we can certainly just update it without
explicitly reassign. If a value type, reassign is necessary....
Regards,
Steven Cheng
Microsoft Online Support
Get Secure!
www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| Subject: Re: =?UTF-8?B?VXNpbmcgdGh lIFNlc3Npb24gb2 JqZWN0?=
| From: "Hans Kesting" <ne***********@ spamgourmet.com >
| References: <em************ *@TK2MSFTNGP09. phx.gbl>
<u9************ **@tk2msftngp13 .phx.gbl>
<uL************ *@TK2MSFTNGP15. phx.gbl>
<uH************ **@TK2MSFTNGP14 .phx.gbl>
| Message-ID: <mn************ ***********@spa mgourmet.com>
| X-Newsreader: MesNews/1.04.01.00-gb
| Date: Mon, 23 Jan 2006 18:03:03 +0100
| MIME-Version: 1.0
| Content-Type: text/plain; charset="utf-8"; format=flowed
| Content-Transfer-Encoding: 8bit
| Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| NNTP-Posting-Host: 127-24.bbned.dsl.in ternl.net 82.215.24.127
| Lines: 1
| Path: TK2MSFTNGXA02.p hx.gbl!TK2MSFTN GP08.phx.gbl!TK 2MSFTNGP15.phx. gbl
| Xref: TK2MSFTNGXA02.p hx.gbl
microsoft.publi c.dotnet.framew ork.aspnet:3729 24
| X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
|
| > That's what I said, and I just tried it out to make sure I wasn't
bonkers.
| >
| > I'm not familiar with BOCSTransaction so anything's possible, but I
think
| > Peter and I are right on this one.
| >
| > Karl
|
| If "BOCSTransactio n" is an object, then this is true (just the
| reference is stored in Session, so you are updating the "real" object).
| However (just to be complete), if "BOCSTransactio n" is a struct
| (ValueType, sorry, don't know the VB name) then you will get a *copy*
| of the stored struct. So then you *will* have to "store back" the
| changed struct.
|
| Hans Kesting
|
|
| >
| > "Peter Rilling" <pe***@nospam.r illing.net> wrote in message
| > news:uL******** *****@TK2MSFTNG P15.phx.gbl... Doesn't the concept of
| > "references " form an automatic link. If he modifies the variable
"trx", then
| > that would also be reflected back in the session version, right?
Unless the
| > value stored in the session is a value type.
| >
| > "Eliyahu Goldin" <re************ *@monarchmed.co m> wrote in message
| > news:u9******** ******@tk2msftn gp13.phx.gbl... Jerry,
| >
| > You are right, you have to update session variables, there is no
| > automatic link.
| >
| > Eliyahu
| >
| > <rl*****@newsgr oups.nospam> wrote in message
| > news:em******** *****@TK2MSFTNG P09.phx.gbl... Simple question, I
| > think...
| >
| > I'm storing an object in the Session object.
| >
| > In the code behind I read that object: trx =
| > CType(Session(" Transaction"), BOCSTransaction )
| >
| > If I change any properties, I have to store it back into the
session
| > object to "update" it, right? Or will the changes to my object
automatically
| > be saved back into the session object?
| >
| > Thanks,
| > Jerry
|
|
|