Results 1 to 7 of 7

Thread: [Resolved] Class Help

Threaded View

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Feb 2005
    Posts
    17

    [Resolved] Class Help

    I have 2 classes

    VB Code:
    1. Public Class One
    2.     Sub MessageOne
    3.          Response.Write("I am from Class One")
    4.     End Sub
    5.  
    6.     Sub OtherMethod
    7.          'Do Something here
    8.     End Sub
    9. End Class
    10.  
    11. Public Class Two
    12.     Sub MessageTwo
    13.          Response.Write("I am from Class Two")
    14.     End Sub
    15.  
    16.     Sub OtherMethod
    17.          'Do Something here
    18.     End Sub
    19. End Class

    Now I create new class and I want to call method MessageOne and MessageTwo.
    VB Code:
    1. Public Class MyClass: Inherits System.Web.UI.Page
    2.     Dim ClassOne As New One
    3.     Dim ClassTwo As New Two
    4.  
    5.     ClassOne.MessageOne()
    6.     ClassTwo.MessageTwo()
    7. End Class

    When I compile, I got error message "Type 'One' is not defined". Note: Class One and class Two are not in the same directory as MyClass. This is ASP.NET.
    Thanks in advance
    Last edited by Winter2OO1; May 16th, 2005 at 08:26 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width