[thelist] ASP.NET: Using a Custom Class
Casey Crookston
caseyc at IntelliSoftmn.com
Thu Jul 20 15:46:02 CDT 2006
Thanks! Any idea how this would be in VB?
-----Original Message-----
You want something like this:
csSendMail objSM;
objSM.func1(var1, var2);
-----Original message-----
From: "Casey Crookston" caseyc at IntelliSoftmn.com
> 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