how to typecast Session object to class object.

  • 12 years ago

    Hello All

     

    I am have an object in the session variable.

    Now, when I retrieve the object from the session variable, i want to typecast it to its class.

    I am using the following code, but its not woking :(

    dim objCustomer ''''As Customer
    SET objCustomer = new Customer

    If IsObject(Session("customer")) Then
        objCustomer = CType(Session("customer"), objCustomer )
    End If

     

    Can u pls let me know, I am missing something.

     

    Ankit

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“C++ : Where friends have access to your private members.” - Gavin Russell Baker