bgreenhouse
Technical User
Hi There
Up until now I've primarily done OOP programming in PHP. Now I'm trying to get something similar in ASP. Basically I'm trying to do a templating thing in ASP where I have all the data for a survey (question text, type, possible answers, etc) in a DB, and Iwant to create a question object that, when instantiated gets all the info out of the database automatically. The thing is in PHP I could instantiate a new object and pass a variable (i.e. the questions number). Then the Initialize event would take this variable (question number) and use it to pull all the properties of that question out of the database and populate the object's variables with those values. Obviously I can do this with a function that's not an initialize event (setting a private variable to the question numbe,r then calling a function that references that internal variable), but then I'd have to make sure I always called it after instantiating the object - I want it to do it automatically as soon as the new object is declared.
I hope this makes sense...
Ben
Up until now I've primarily done OOP programming in PHP. Now I'm trying to get something similar in ASP. Basically I'm trying to do a templating thing in ASP where I have all the data for a survey (question text, type, possible answers, etc) in a DB, and Iwant to create a question object that, when instantiated gets all the info out of the database automatically. The thing is in PHP I could instantiate a new object and pass a variable (i.e. the questions number). Then the Initialize event would take this variable (question number) and use it to pull all the properties of that question out of the database and populate the object's variables with those values. Obviously I can do this with a function that's not an initialize event (setting a private variable to the question numbe,r then calling a function that references that internal variable), but then I'd have to make sure I always called it after instantiating the object - I want it to do it automatically as soon as the new object is declared.
I hope this makes sense...
Ben