You shouldn't declare the instance of your class inside of your
Page_Load event. Instead, declare it as either a private or public
variable so other subs/functions inside of your page can access the
instance. See below:
Private myClass As new customClass
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
'Put user code to initialize the page here
End Sub
Private sub DoSomething()
Dim strTemp as string
strTemp=myclass .getReturnStrin g()
end sub
Private sub DoSomethingAgai n()
Dim strTemp as string
strTemp=myclass .getOtherReturn String()
end sub
"Ray at <%=sLocation% >" <myfirstname at lane 34 . komm> wrote in message news:<uN******* *******@TK2MSFT NGP10.phx.gbl>. ..
http://www.aspfaq.com/5002
Ray at home
"Christian Ista" <ma**********@i stasofts.com> wrote in message
news:er******** ******@TK2MSFTN GP11.phx.gbl... Hello,
I have a class. I create an instance of this class in Page_Load event.
Somewhere in the page I'd like to execute an a function (public) member of
this class. This function return a string. How can I call this function ?
Thanks,
C.