Best Practice, creating a composite of controls

G

Guest

I have a collection of controls I am using on several pages. I have:
1 Image
2 Labels

I want to combine these so that I will also have certain properties
available programatically.

I want to be able to set a 'photoId' Property, that, when set, will call
data from a database, set the Image's src property, and set the Label text.

I want 2 other properties (ReadOnly) to be available programatically, that
when the Get is fired, checks a couple of things and returns the result.

I know how to do all this, except to combine them in one control that I can
reuse. I'm doing it over and over again in 3 or 4 pages, but when I tried to
create a user control with codebehind, I am running into trouble.

Can you point me to online resources that could give me a walkthrough?
 
G

Guest

That helped, got me in the right direction. The thing I don't like, is now I
have to address my object like this:
CType(Me.Preview1, previewCtrl).ImageOrderNum = Me._jobNum
CType(Me.Preview1, previewCtrl).PhotoID = Me._photo

whenever I want to access properties.
Monday I am going to try to work on raising and handling events from that in
the consuming pageI am wondering if I may need to create my own server
control... but I'm not sure.
 

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

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top