Results 1 to 5 of 5

Thread: Modules?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2001
    Location
    UK
    Posts
    271

    Question 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,
    §tudz

    Studzworld.com - Portfolio

  2. #2
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    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.

  3. #3
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    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.

  4. #4
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    Oh ok... thanks for the clarification. I don't ever use Modules so I really wouldn't know.

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2001
    Location
    UK
    Posts
    271
    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
    §tudz

    Studzworld.com - Portfolio

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width