[thelist] ASP.NET: Using a Custom Class

Anthony Baratta anthony at baratta.com
Thu Jul 20 15:33:22 CDT 2006


You want something like this:

      csSendMail objSM;
      objSM.func1(var1, var2);

-----Original message-----
From: "Casey Crookston" caseyc at IntelliSoftmn.com
Date: Thu, 20 Jul 2006 13:10:50 -0700
To: thelist at lists.evolt.org
Subject: [thelist] ASP.NET: Using a Custom Class

> Hi,
> 
> I've created a class file as such:
> 
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> Imports ...
> 
> Namespace quickCommands
> 
>     Public Class csSendMail
> 
>         Public Function func1(ByVal var1, ByVal var2)
> 
>             ...
> 
>             Return emailText
> 
>         End Function
> 
>     End Class
> 
> End Namespace
> 
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> Now, in a code behind file, I want to use func1.  So I've done this:
> 
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> Imports projName.quickCommands
> 
> Public Class WebForm1
> 
>     Inherits System.Web.UI.Page
> 
>     Sub btn_click(ByVal sender As Object, ByVal e As System.EventArgs)
> 
>         csSendMail.func1(var1, var2
> 
>     End Sub
> 
> End Class
> 
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> But, at csSendMail.func1, I'm being told: Reference to a non-shared
> member requires an object reference
> 
> What am I missing?  How do I reference the object?  I thought
> "projName.quickcommands" took care of that.




More information about the thelist mailing list