Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing variables from an instantiated class to an ASP page

Status
Not open for further replies.

Johnnie100

Programmer
Dec 8, 2000
31
GB
I am writing an ASP page and am using a class I developed in VB (easier to debug when manipulating text strings), are there any tips out there in general when using a class developed in VB to be transferred into ASP?

The main point I'm writing about however, is I am trying to use a public variable in the ASP page and just write to this from within the class - this should be possible shouldn't it? Can I use public varibles to be referenced by other ASP pages/classes within the same directory on the IIS? How do you reference public variables in general in ASP.

Thanks
Johnnie100
 
You should be able to do a simple assignment to an ASP variable from your VB Class after it has been instantiated, example:
Code:
'pretend we have an object myObject that is your vb object
Dim myVar
myVar = myObject.myPublicVariable
It should be as simple as that. If this hasn't been working than try creating a public property in your class with the get property:
Code:
Public Property Get MyPubliVar as variant
   MyPublicVar = MyVarInMyClass
End Get

Then just access it like I had in the first example.

-Tarwn ________________________________________________
Get better results for your questions: faq333-2924
Frequently Asked ASP Questions: faq333-3048
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top