Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Session.Add method - what if called multiple times with the same k

Reply
Thread Tools

Session.Add method - what if called multiple times with the same k

 
 
=?Utf-8?B?TWFydGlu?=
Guest
Posts: n/a
 
      01-28-2005
I wonder what is happening if you subsequently use the session.add method
with the same key, but different values.

e.g. if I do;
session.add("MyVar", "a")
session.add("MyVar", "b")

then; session("MyVar").tostring will return "b"

Is the value you are adding ("b") simply replacing the olde value ("a")
If so, should the name of the method then not be something like session.set,
because you are not actually adding anything.

Can't find anything about this in the documentation. Some explaination is
appreciated.
 
Reply With Quote
 
 
 
 
Vadivel Kumar
Guest
Posts: n/a
 
      01-28-2005

Hi,

I believe it is because of MS wants to reduce the number of
properties/methods etc.,
and It makes sense when assuming that Session is a memory area ( like a
container)
where you will add up all your values. "Set" sounds to be setting some thing
with determined manner.

Hope, this makes sense

Cheers!

"Martin" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I wonder what is happening if you subsequently use the session.add method
> with the same key, but different values.
>
> e.g. if I do;
> session.add("MyVar", "a")
> session.add("MyVar", "b")
>
> then; session("MyVar").tostring will return "b"
>
> Is the value you are adding ("b") simply replacing the olde value ("a")
> If so, should the name of the method then not be something like
> session.set,
> because you are not actually adding anything.
>
> Can't find anything about this in the documentation. Some explaination is
> appreciated.



 
Reply With Quote
 
 
 
 
T Saravana MMPatti,CBE T Saravana MMPatti,CBE is offline
Junior Member
Join Date: Dec 2011
Posts: 1
 
      12-16-2011
Hi ,

I was also same doubt like this. i have implemented this scenario in my client application. it is working fine. So


Regards

Saravanakumar T, M.M.Patti Coimbatore.



Quote:
Originally Posted by Vadivel Kumar View Post
Hi,

I believe it is because of MS wants to reduce the number of
properties/methods etc.,
and It makes sense when assuming that Session is a memory area ( like a
container)
where you will add up all your values. "Set" sounds to be setting some thing
with determined manner.

Hope, this makes sense

Cheers!

"Martin" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I wonder what is happening if you subsequently use the session.add method
> with the same key, but different values.
>
> e.g. if I do;
> session.add("MyVar", "a")
> session.add("MyVar", "b")
>
> then; session("MyVar").tostring will return "b"
>
> Is the value you are adding ("b") simply replacing the olde value ("a")
> If so, should the name of the method then not be something like
> session.set,
> because you are not actually adding anything.
>
> Can't find anything about this in the documentation. Some explaination is
> appreciated.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple sproc executes 240 times slower when called from asp.net thanwhen called from QA Radu ASP .Net 7 08-28-2009 09:09 PM
WebService called by automation dll times out when being called from Navision Felix ASP .Net Web Services 1 09-29-2006 01:43 PM
three times copy ctor called, one ctor called, why? Apricot C++ 4 04-16-2004 07:55 AM
Why is the PropertyDescriptor's GetValue method called multiple times when selecting the descriptor into the PropertyGrid? mark belles ASP .Net Building Controls 4 01-23-2004 09:26 PM
Why is the Constructor called 4 times but the Destructor 5 times? djskrill C++ 9 10-01-2003 07:18 PM



Advertisments