473,396 Members | 1,967 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Webusercontrol, Image is nothing -- why?

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
Nov 19 '05 #1
1 1275
The Image control must point to a URL.
It doesn't have to point to a JPG or GIF, it can point to an ASPX.
Within THAT ASPX is there you should generate the image.
Here's more info:
http://SteveOrr.net/articles/EasyUploads.aspx
http://www.aspnetpro.com/features/20...200412so_f.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net

"Selden McCabe" <se*****@msn.com> wrote in message
news:%2******************@TK2MSFTNGP14.phx.gbl...
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

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Mike Levin | last post by:
Hello Group, I'm using VisualStudio.NET and put a DataGrid into a WebUserControl (an ascx file). For the DataGrid element, I have set AllowSorting="True" and OnSortCommand="Grid_Sort".
1
by: DichkoSoft | last post by:
Hi I create WebUserControl and very confused when use control For Example: ***************************** *wuc.ascx ***************************** <script id=clientEventHandlersJS...
0
by: Christian H | last post by:
Hello, I've just created a WebUserControl that consists of a few other controls such as DropDownList, TextBox and Button. Based on the information entered in the DropDownlist, and TextBox, the...
2
by: Oren | last post by:
Hello everyone... I have a simple WebUserControl with Button and TextBox on it. Webform1.aspx contains this WebUserControl. How can I create my own C'tor for this WebUserControl - I mean when I...
2
by: Oren | last post by:
Hi everyone, I have WebUserControl on a Webform. How can I sent dynamically to the WebUserControl from a Function/Property on the Webform ? <uc:myuc id="myid1" CurrentPage=<%#GetText()%>...
0
by: Giovanni | last post by:
Dear Friends, I have a decision to make and hope to get some insight: I have built several WebUserControls one of which is a WebUserControl that queries an SQL server database, retrieves a...
0
by: Terry Olsen | last post by:
In an effort to create a QueryBuilder for a web page, I've created a WebUserControl. It can be seen here: http://boycot.no-ip.com/images/querybuilder.jpg I load one control initially in the...
0
by: Klaus Jensen | last post by:
Hi In a repeater-control, in the <SeparatorTemplatei have placed a webusercontrol, I have made. That works great- However, I want to know be able to only display this WebUserControl a certain...
1
by: deeparengan | last post by:
hi in asp.net i have a webusercontrol that has three dropdownlist.In the first dropdownlist i loaded the data at design time and in second dropdownlist i load the some data at run time according to...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.