473,568 Members | 3,014 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ASP.NET>Call function

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.

Jul 19 '05 #1
2 8545
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.

Jul 19 '05 #2
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.

Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2424
by: Yu Lianqing | last post by:
Hi, all I am writing an overloading operator >> function for a template class and can't make it right. G++ 3.2 (Redhat8.0) gives the following errors: g++ -c list.cxx In file included from SLinkList.cxx:3, from list.cxx:1: SLinkList.h:20: ISO C++ forbids declaration of `type name' with no
7
3840
by: Malcolm Cook | last post by:
Hi, I've created and installed a custom UDF to populate my combobox, and have defined it per : http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbaac10/html/acproRowSourceTypeFunctionParameters.asp I'm using ACC2002 in an ADP. However, I'm finding that he control variable (called "code" in the above documentation), is...
3
2452
by: Mika M | last post by:
Hi! I try to convert some VB.NET 2003 code into C# 2003 code. Code uses Sax.Communications COM-port control, and VB code is working fine. Here is part of VB Class code I'm trying to convert... Imports Sax.Communications '// Importing component Namespace Private WithEvents _ComPort As SerialConnection '// Declaration Com-port
3
1257
by: Eirik Eldorsen | last post by:
I'm tring to translate an VB.NET method into C#. Here is what I've done so far. Need help on the while loop public static void SetInitialFocus(Control ctrl) { StringBuilder s = new StringBuilder(); s.Append("<SCRIPT LANGUAGE='JavaScript'>"); s.Append("function SetInitialFocus()"); s.Append("{"); s.Append(" document.");
3
2086
by: Monty | last post by:
OK, I had an issue with this and found lots of advice that did not apply, so I'm posting what I found hoping it might help someone else. Here's the sitch: you have a COM app that calls to a .Net assembly which in turn calls a web service. You know the web service is reachable and that the COM app is able to instantiate your .Net assembly...
7
1244
by: nime | last post by:
I tried to port from VB to C# and now I'm stuck. I couldn't convert the VB line readdata = dt.Rows(0)(data) as C#: return dt.Rows; Error detail:
1
2708
by: gus | last post by:
Hi I've been asked to convert some code from VB 6 to Vb .Net and I've come across some problems. The main one is that the variable type 'any' is no longer supported. However, the library function I'm using has the 'as any'... so I'm at a loss how to convert the code. Any help would be greatly appreciated Thanks 'UPGRADE_ISSUE:...
0
924
by: Matt Nunnally | last post by:
I have a .NET dll that I'm using in Vb6. After registering with regasm and referencing the tlb, I am unable to compile when I call properties declared as LONG in my VB.NET dll. I get an error something to the effect of Function or Interface restricted, Automation type not supported. Any ideas?
0
1552
by: =?Utf-8?B?c3Bhcmtlcg==?= | last post by:
Has anybody had the occasion to to build a VB.NET 2008 application that will manipulate an Excel workbook including the Hyperion Essbase Plugin? I was not sure which forum to post this question in so that is why I have chosen the General. If anybody has any ideas on the "Best" way to execute the "Retrieve" function found on the Essbase plugin...
1
7665
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7962
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6277
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5501
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5217
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3651
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3631
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2105
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
933
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.