473,407 Members | 2,320 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,407 software developers and data experts.

Access listbox on dynamic control

Hello!

I have a user control (ascx) which simply has a couple textboxes and a
listbox... On a page that has a could of them, dynamically created, I am
having a weird problem with the listbox..

There are 2 items in the listbox, however...

Response.Write(CType(MedstarLoginControl.FindContr ol("lbMedstarFacilities"),
ListBox).Items.Count)

Displays 0

If I do this on the very next line...
CType(MedstarLoginControl.FindControl("lbMedstarFa cilities"),
ListBox).SelectedIndex = 1

It does select the second item in the list box....

But if I do this right afterwards....

For Each li As ListItem In
CType(MedstarLoginControl.FindControl("lbMedstarFa cilities"), ListBox).Items
Response.Write(li.Text)
Next

Nothing happens, because it still thinks there are no items...... Help!!!!

Thanks,

Matt
Feb 27 '07 #1
0 951

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

Similar topics

3
by: Magno101 | last post by:
Hi all, First let me start out with what I want to happen with this and then maybe y'all can give me some better insight. I have a database in Microsoft Access which we need to upsize to SQL. We...
1
by: mlarson | last post by:
Hello, I'm working on a page that dynamically creates listboxes and the "options" that are added to the listbox. A user can then click on buttons to either add or delete the "options" from one...
2
by: N. Demos | last post by:
I have a user control with code behind of which two instances are created/declared in my aspx page. The aspx page has code behind also, as I need to access methods of the usercontrols on page...
1
by: JMann101 | last post by:
I am writing a ASP.NET(VB) application and am having some trouble. I have a datagrid which list users and when an admin clicks "edit" a defined column becomes visible and a dynamic listbox control...
0
by: David J | last post by:
Hi, I am strugling with the propertygrid and a listbox. I am using the universaldropdowneditor from the codeproject (code below). However I am populating the listbox via a datasource. The problem...
2
by: Marcos Beccar Varela | last post by:
Hello, I´m trying to access to an event of a listbox, thats inside an user control. Whenever the listbox changes a value I need to rise an event. Is there a way of doing this? MyUserControl >...
5
by: mikez | last post by:
Hi, We recently built a very basic file management system for a client in Access 2003 (to use with incoming tif scans). In it we used Microsoft's Document Imaging activex viewer (from Office...
2
by: cshaw | last post by:
Hello Everyone, I am having problems with a listbox control. I have a page with a couple of labels and drop-down lists at the top, and then below there is a table with two columns, the first column...
6
by: GS | last post by:
how can I set tooTip on ToolTip1 for a listbox?
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.