Ask a Question related to ASP, Design and Development.
-
Philip Chan #1
HELP: My ASP class object is crippled if I save it in a session collection
I am using ASP3.0 and IIS5
I want to have OOP so I have define a class call Employee with
property 'fullName' and methods like getFullName().
To save a group of employee in session, I use a dictionary.
-----------------
dim employees
set employees = CreateObject("Scripting.Dictionary")
dim vpOfSales
set vpOfSales = new Employee
vpOfSales.fullName = "Brian Miller"
response.write vpOfSales.getFullName() ' work here
employees.add "vpOfSales", vpOfSales
Set session("employees") = employees
....
-----------------
The problem came when I retrieve the Employee objects in *another*
page
-----------------
dim employees
Set employees = session("employees")
for each person in employees
response.write person.getFullName() ' have error here
next
....
-----------------
ASP complain the object doesn't have a property or method
getFullName().
What is the problem?
Is there a solution?
Philip Chan Guest
-
Commons Collection Class Not Found Error
I've just started playing with Style Sheets . <mx:Style source="amethyst.css"/> Contents of the style sheet: Label { border-bottom-style:solid;... -
Loading of Class Object passed via PHP Session fails!
Hello! I try to use PHP session function, and it doesn't work properly. :-( I want to pass a whole object from site A to site B to minimize... -
Collection class bound to DataGrid doesn't use my custom enumerator!
Hello, I'm trying to implement a PageableCollection class so I can easily add custom paging functionality to my apps without the overhead of... -
I need to save a class object in a Session variable. Good? Bad?
Hi, I am in a situation where I am forced into passing a class object around between a bunch of pages. The only way that I can figure out how to... -
getting name of class and/or parent class that object belongs to
ed <coo_t2-NO-LIKE-SPAM@yahoo.com> wrote: : : Hey all. I'd like to convert some PHP code to Perl, but I'm not sure : how to do it in Perl. :... -
Bite My Bubbles #2
Re: My ASP class object is crippled if I save it in a session collection
hI, iiLL SAVE YOU SOME HAIR PULLING.
I did the same thing, same result.
Turns out this is by design - You can't do that! You can't use classes in
asp, and have them work across pages, such as with session variables
There are articles about it out there, but it comes down to the fact that
since the class can't be guaranteed to be the same across pages, it isn't a
proper class.
"Philip Chan" <philip.chan@uctv.ca> wrote in message
news:2d7a757a.0309051248.aedfc4b@posting.google.co m...> I am using ASP3.0 and IIS5
>
> I want to have OOP so I have define a class call Employee with
> property 'fullName' and methods like getFullName().
>
> To save a group of employee in session, I use a dictionary.
>
> -----------------
> dim employees
> set employees = CreateObject("Scripting.Dictionary")
>
> dim vpOfSales
> set vpOfSales = new Employee
> vpOfSales.fullName = "Brian Miller"
>
> response.write vpOfSales.getFullName() ' work here
> employees.add "vpOfSales", vpOfSales
>
> Set session("employees") = employees
> ...
> -----------------
>
> The problem came when I retrieve the Employee objects in *another*
> page
> -----------------
> dim employees
> Set employees = session("employees")
> for each person in employees
> response.write person.getFullName() ' have error here
> next
> ...
> -----------------
> ASP complain the object doesn't have a property or method
> getFullName().
> What is the problem?
> Is there a solution?
Bite My Bubbles Guest



Reply With Quote

