|
-
Apr 3rd, 2004, 01:50 PM
#1
Thread Starter
Hyperactive Member
Modules?
Hey there all,
I am writing a forum in asp.net, its coming along great, but I thinkI may be making the job harder than it should be.
Heres my question:
I am using VisualBasic ASP.net and well I need have several routines which will be exectly the same for each page, such as 'Private message check' and such like. In vb6 and .net you are able to have modules, I'm not writing the forum as an application, but as plain aspx files.
is is possible to have a page or module, that stores all the routines that I will need, and be able to call them from the file when required?
If so how do I do this?
Thanks,
-
Apr 3rd, 2004, 02:17 PM
#2
I wonder how many charact
Right-click your project, Click Add New Class...
Anywhere you need it, instantiate it with a new operator, and use its methods.
And forget the term Modules... Modules are just classes (so are WebForms), but they are named Modules so VB6 people could assimilate.
-
Apr 3rd, 2004, 06:58 PM
#3
PowerPoster
Modules are classes, but they are special classes. Everything in them is shared (you don't have to create an instance of the class in order to use the properties/methods). This is a big difference compared to a normal class because you have to create an instance in order to use it.
It is basically like you are using the 'shared' keyword when declaring things, but without having to actually do it. In C#, the keyword is 'static' that marks the properties/methods as shared accross all instances.
-
Apr 3rd, 2004, 07:42 PM
#4
I wonder how many charact
Oh ok... thanks for the clarification. I don't ever use Modules so I really wouldn't know.
-
Apr 4th, 2004, 04:19 AM
#5
Thread Starter
Hyperactive Member
ok, thanks for the replies, but I'm not creating the site in V.Studio I using WebMatrix (unfortunatly) as I was told that using V.Studio , ment I required a different host, and there would more coding to do something in V.Studio compaired to webmatrix?
so can I still do it use webmatrix?
thanks again
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|