Results 1 to 6 of 6

Thread: User Defined Class???

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2004
    Posts
    5

    Question User Defined Class???

    My question is this. I am writing a web-based application and I will need a lot of validation functions (quite possibly more than 100 different functions). In some cases the same validation function will be needed on multiple pages. Is there a way for me to create a "User Defined Class" or set of global functions so that I only have to store the validation functions once and can call them at any time instead of having to put the validation function within each page? The reason for wanting to do this is for maintenance and storage purposes. I want to be able to change the function once for all pages.

    Any thoughts and ideas on how to accomplish this using Visual Studio .NET would be great.

    Thanks!

    -Kim

  2. #2
    Addicted Member
    Join Date
    Aug 2003
    Posts
    153
    I am not an ASP.Net developer. But I do this sort of thing in my windows applications via a module. Can't see how it would work any different in ASP.Net

  3. #3
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Apparently , you don't know the concept of OOP , do you ?

  4. #4

    Thread Starter
    New Member
    Join Date
    Jul 2004
    Posts
    5

    Re-word...

    Actually I do understand OOP (all my oop schooling was using C++ and even though the concept isn't different the environment is)...and say in Microsoft Access I would know exactly where to create a module to do exactly what I asked.

    My problem is that I don't know Visual Studio .Net well enough yet to know where within Visual Studio .Net to do this. Since I am just getting started on the application (the first one I have written using VS.NET) I want to do it right the first time which means I need some sort of a user defined class or place to put global functions. The question is where within the application using VS.NET does it get put?

    Thanks,
    -Kim

  5. #5
    Frenzied Member Mike Hildner's Avatar
    Join Date
    Jul 2002
    Location
    Des Moines, NM
    Posts
    1,690
    One way to add a class is to right click on your project, click add, then click add new item - you see a dialog box of all the things you can add.

  6. #6
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    If you do understand it then why don't you create these functions in a class files with base/inherited classes . You might like to mark these common functions with shared so you can call them from anywhere and without instantiating the class .

    Project Menu , Add Class menuitem . Then start coding .

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