If they are not related, then I would store them in seperate session
variables.
If they're related....lets say you want to store the
EmpID (int) and EmployeeLoginName (string), I would create a mini wrapper
object.
[Serializable]
public class EmployeeLoginInfo
{
private int _empID = 0;
private string _employeeLoginName = string.Empty;
public EmployeeLoginInfo( int empID , string employeeLoginName )
{
_empID = empID;
_employeeLoginName = employeeLoginName;
}
public int EmpID { { return _empID;}}
public string EmployeeLoginName { get { return _employeeLoginName;}}
}
and then I would session that mini object.
Delimited String << Heck No
Array << Heck No
That's my vote.
To me, using the mini object means I only have to pay the casting price
once.
And my code make more sense, because I don't have a bunch of disjoint
properties flying all over the place.
You can check this blog entry as well:
http://sholliday.spaces.live.com/Blog/cns!A68482B9628A842A!151.entry
> hey all,
> can someone please tell me if there's a big difference among the
[quoted text clipped - 8 lines]
> thanks,
> rodchar
Mark Rae [MVP] - 08 Mar 2008 14:33 GMT
> [Serializable]
Not necessary if the class to be stored in Session contains only primitive
datatypes:
http://safari.oreilly.com/0596001177/progcsharp-CHP-21-SECT-6
> Delimited String << Heck No
Agreed.
> Array << Heck No
Probably not, though generics are usually OK to store in Session...

Signature
Mark Rae
ASP.NET MVP
http://www.markrae.net
rodchar - 09 Mar 2008 17:54 GMT
should the mini object be nested in a class or would it be better in a
separate file?
> If they are not related, then I would store them in seperate session
> variables.
[quoted text clipped - 47 lines]
> > thanks,
> > rodchar
Mark Rae [MVP] - 09 Mar 2008 18:20 GMT
>> public class EmployeeLoginInfo
>>
>> and then I would session that mini object.
>
> should the mini object be nested in a class
The (mini) object *is* a class...
> or would it be better in a separate file?
Totally irrelevant to the compiler...

Signature
Mark Rae
ASP.NET MVP
http://www.markrae.net
thanks for the help everyone,
rod.
> hey all,
> can someone please tell me if there's a big difference among the following:
[quoted text clipped - 7 lines]
> thanks,
> rodchar