P
Paul
Hello,
I'm coming from a PHP background and am working on a large-scale VB.NET
project. One of the cornerstones of this project is a reusable form
class, to standardize our web forms.
My goal is to have a true hierarchical parent form class with child
form element classes. The programmatic code would be something like
this, ideally (sorry about the lame names, but it's just for demo):
MyForm = New SuperFormClass()
MyFormRadio1 = New SuperFormClass.RadioButton()
MyFormRadio1.Label = "Please select something."
MyFormRadio1.Id = "radio_blah"
MyFormRadio1.AppendToParent()
MyForm.Render()
So I want the child form element to work extensively with *that
particular instance* of the parent form class. I can't make a
RadioButton without a SuperFormClass, so I want SuperFormClass to act
as a container - with its own properties and methods.
I need to know the most practical way to pull this off. My research so
far has steered me towards nested classes, but I'm now investigating
namespaces. Most of the issue right now is syntax; I know how I'd code
this in PHP, for sure, and need to essentially translate it. I also of
course need to know if VB.NET will support this type of structure!
If anyone can help I'd appreciate it - and I'd be happy to answer more
specific questions. Thanks.
- Paul
I'm coming from a PHP background and am working on a large-scale VB.NET
project. One of the cornerstones of this project is a reusable form
class, to standardize our web forms.
My goal is to have a true hierarchical parent form class with child
form element classes. The programmatic code would be something like
this, ideally (sorry about the lame names, but it's just for demo):
MyForm = New SuperFormClass()
MyFormRadio1 = New SuperFormClass.RadioButton()
MyFormRadio1.Label = "Please select something."
MyFormRadio1.Id = "radio_blah"
MyFormRadio1.AppendToParent()
MyForm.Render()
So I want the child form element to work extensively with *that
particular instance* of the parent form class. I can't make a
RadioButton without a SuperFormClass, so I want SuperFormClass to act
as a container - with its own properties and methods.
I need to know the most practical way to pull this off. My research so
far has steered me towards nested classes, but I'm now investigating
namespaces. Most of the issue right now is syntax; I know how I'd code
this in PHP, for sure, and need to essentially translate it. I also of
course need to know if VB.NET will support this type of structure!
If anyone can help I'd appreciate it - and I'd be happy to answer more
specific questions. Thanks.
- Paul