locked
Object variable is not member of class error RRS feed

  • Question

  • User-982002537 posted

     

     

    Hello! I try to declare a variable in a class but I get an error reading that the variable is not a member of the current class. I have imported the class "Base" where the class PageManager is located. What am I doint wrong? I appreciate any help, please!

    Imports Base

     Public Class Main

     

    Private Sub Booking()

     Dim oSystemManager As SystemManager = Me.PageManager.LoadBookingSystem(DBInfo, Request.PhysicalApplicationPath)

    ' As I declare this variable I get an error reading "PageManager" is not a member of "Main". (PageManager is a member of the class "Base" )

     

    Thanks in advance!

    Tuesday, September 9, 2008 3:46 AM

All replies

  • User1394477824 posted

     

     

    Hello! I try to declare a variable in a class but I get an error reading that the variable is not a member of the current class. I have imported the class "Base" where the class PageManager is located. What am I doint wrong? I appreciate any help, please!

    Imports Base

     Public Class Main

     

    Private Sub Booking()

      

    Dim oSystemManager As SystemManager = Me.PageManager.LoadBookingSystem(DBInfo, Request.PhysicalApplicationPath)

    ' As I declare this variable I get an error reading "PageManager" is not a member of "Main". (PageManager is a member of the class "Base" )

     

    Thanks in advance!

     

     

    Try this code... 

     Dim oSystemManager As SystemManager = MyBase.PageManager.LoadBookingSystem(DBInfo, Request.PhysicalApplicationPath) 

    Instead of Me, use MyBase.

    Thanks

    Anand

     

     

     

    Tuesday, September 9, 2008 6:57 AM