N
Nathan Sokalski
In several of my UserControls I add properties. If I access these properties
in the CodeBehind of the pages that use the controls, I recieve an error
when compiling. The reason for this is because the compiler tries to compile
the pages that use the UserControls before compiling the UserControls, and
therefore does not know that the property exists when compiling. The only
way around this that I have found is to use the CType() function as follows:
CType(MyUserCtrlInstance, MyUserCtrlClass).AddedProperty
instead of:
MyUserCtrlInstance.AddedProperty
Even though this works, it is a lot of extra CType() functions that would
not be necessary if I could simply have my UserControls compiled first. Is
there any way to make the compiler look at my UserControls first without
putting them in a separate assembly? Thanks.
in the CodeBehind of the pages that use the controls, I recieve an error
when compiling. The reason for this is because the compiler tries to compile
the pages that use the UserControls before compiling the UserControls, and
therefore does not know that the property exists when compiling. The only
way around this that I have found is to use the CType() function as follows:
CType(MyUserCtrlInstance, MyUserCtrlClass).AddedProperty
instead of:
MyUserCtrlInstance.AddedProperty
Even though this works, it is a lot of extra CType() functions that would
not be necessary if I could simply have my UserControls compiled first. Is
there any way to make the compiler look at my UserControls first without
putting them in a separate assembly? Thanks.