Re: Using the Session object
- From: stcheng@xxxxxxxxxxxxxxxxxxxx (Steven Cheng[MSFT])
- Date: Tue, 24 Jan 2006 02:29:17 GMT
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?VXNpbmcgdGhlIFNlc3Npb24gb2JqZWN0?=
| From: "Hans Kesting" <news.2.hansdk@xxxxxxxxxxxxxxx>
| References: <emVpLIDIGHA.312@xxxxxxxxxxxxxxxxxxxx>
<u9HGsPDIGHA.3728@xxxxxxxxxxxxxxxxxxxx>
<uLtarbDIGHA.216@xxxxxxxxxxxxxxxxxxxx>
<uHBwheDIGHA.1188@xxxxxxxxxxxxxxxxxxxx>
| Message-ID: <mn.bc3b7d61c6520cf0.43821@xxxxxxxxxxxxxxx>
| 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.public.dotnet.framework.aspnet
| NNTP-Posting-Host: 127-24.bbned.dsl.internl.net 82.215.24.127
| Lines: 1
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP15.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:372924
| X-Tomcat-NG: microsoft.public.dotnet.framework.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 "BOCSTransaction" 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 "BOCSTransaction" 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" <peter@xxxxxxxxxxxxxxxxxx> wrote in message
| > news:uLtarbDIGHA.216@xxxxxxxxxxxxxxxxxxxxxxx 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" <removemeegoldin@xxxxxxxxxxxxxx> wrote in message
| > news:u9HGsPDIGHA.3728@xxxxxxxxxxxxxxxxxxxxxxx Jerry,
| >
| > You are right, you have to update session variables, there is no
| > automatic link.
| >
| > Eliyahu
| >
| > <rlrcstr@xxxxxxxxxxxxxxxxx> wrote in message
| > news:emVpLIDIGHA.312@xxxxxxxxxxxxxxxxxxxxxxx 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
|
|
|
.
- Follow-Ups:
- Re: Using the Session object
- From: Eliyahu Goldin
- Re: Using the Session object
- References:
- Using the Session object
- From: rlrcstr
- Re: Using the Session object
- From: Eliyahu Goldin
- Re: Using the Session object
- From: Hans Kesting
- Using the Session object
- Prev by Date: Re: Smart Navigation property causing infinite Page Reload (v 1.1)
- Next by Date: Safari Timeouts, Status Codes 302, 200, and 400 Bad Request
- Previous by thread: Re: Using the Session object
- Next by thread: Re: Using the Session object
- Index(es):
Relevant Pages
|