Webusercontrol, Image is nothing -- why?

S

Selden McCabe

I have a webusercontrol with several controls on it, including an image
control.

I've coded a public sub "Display" which puts an image in the Image control.

The problem is, when I call Display, the Image control is nothing. Why?
In fact, when I get to this point, all the controls (lblPrice, etc.) are
nothing.. Why?

Here's some code:

Public Sub Display()
'refresh controls, show picture and text
Try
DisplayImageBytes(m_Image, Image1, "Package1")
lblContents.Text = m_Contents
lblPrice.Text = m_Price.ToString("{0:c}")
Catch ex As Exception
End Try
End Sub

When this executes (it gets called from the parent form which contains the
usercontrol) it gives me an error because it says Image1 is nothing.

What's going on?

Thanks!
---Selden McCabe
 

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

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,195
Latest member
tewan

Latest Threads

Top