Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Where to put Sub functions?
Message
From
22/10/2003 18:06:55
 
 
To
22/10/2003 18:00:27
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00841315
Message ID:
00841345
Views:
23
>>I think everything in .Net has to be in a class.
>
>Ok
>
>>Create a WebCommon class with your method in it. Make the method static and you can call it from both aspx pages.
>
>I'm new to this. What would be the step in order to make this new class static.

I'm a C#'er so not 100% sure of the VB syntax. But, the fact of the method being static isn't what makes it callable from both pages, I guess I kinda misstated that. Making it static allows you to call it without instanciating the class. So, in your code you can just do...

MyResult = WebCommon.MyStaticMethod(Whatever)

without having to createobj, or whatever you do to instanciate in VB.Net.

If the webcommon class is in the same project and the same namespace as your aspx pages it should be callable. If you want to put your webcommon in another project you would have to add a reference to that project from your webpage's project to use it.

BOb
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform