How do I use a class with my asp.net page?

  • Thread starter Thread starter COHENMARVIN
  • Start date Start date
C

COHENMARVIN

I have a class written in visual basic that I would like to call from
an aspx page.
The vb file is called "encryption.vb", and it contains:
Namespace Encryption
Public Class Hash
Public Class Symmetric
and more classes
I don't know how to call these classes from a aspx page. Do I need to
compile the encryption.vb file? And if so, how would I refer to the
classes from within my aspx page?
Thanks in advance
Marvin
 
Hi,
Compile it to .dll library file and add these .dll reference to ur
ASP.NET project.
 
Are these classes in the same project as the aspx page? If so, just
create a variable on the Form1.vb page (if you're using code-behind).
Keep in mind though, the name of the file has nothing to do with the
class itself, you actually just have two classes there, named Hash and
Symmetric. The namespace also cannot be initialized:

Private mHash As Encryption.Hash
Private mSymmetric As Encryption.Symmmetric

Private mEncryption As Encryption (this will not work)

Also, do you mean calling the classes from that actualy html source of
the file? That would be a little different.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top