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

controls.contains?

djc
<snippet from .net documentation>
If Panel1.Controls.Contains(NewPanelButton) Then
RemoveHandler NewPanelButton.Click, AddressOf _
NewPanelButton_Click
Panel1.Controls.Remove(NewPanelButton)
NewPanelButton.Dispose()
End If
</snippet from .net documentation>

I need to be able to first check if a control exists within a panel and take
action based on its existence. The above method seems like it would fit the
requirement but I get a compile error "Name nameOfControl is not declared".
It seems this method is meant to see if a control 'contains' another control
so how can it be required for the control name passed in to exist first? The
control I need to check for is dynamically created and thats why I need to
check for its existance in the first place. So it may or may not exist????

????
Nov 19 '05 #1
0 1298

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

Similar topics

2
by: Paperback Writer | last post by:
Hi everybody! I tryed to use the Controls.Count in my WebForm to get the number of controls, but it's always showing 3 Controls! In the UserControls it works perfectly!!! Is tha a bug or do I...
4
by: Michael | last post by:
Thank you for any help you can provide. This is what I have: index.aspx - contains nothing but a form with runat = server header.ascx - contains asp image box welcome.ascx - contains text...
2
by: Michael | last post by:
Need some help trying to read values from web controls - specifically *finding* the controls (like a drop down list) - that are added dynamically added within an asp:panel control. The page...
6
by: Ryo | last post by:
Hello ! I have an .aspx page that use a master page. I want to do a for each that list all controls on this page. I have try something like: foreach (System.Web.UI.Control wct in this.Controls)...
2
by: JohnR | last post by:
Let's say I have an MDI parent form with a textbox. If I create an MDI child form and, at runtime, move the MDI child window over the textbox on the MDI parent, the textbox appears in front of the...
4
by: Michael | last post by:
Hi everyone, I just used the upgrade wizard to upgrade a project of mine. One of the main forms I have has over 200 controls on the form, Uses some tab controls. Now, I have a main tab control...
15
by: Arpan | last post by:
Consider the following code which retrieves data from a SQL Server 2005 DB table & displays it in a DataGrid: <script runat="server"> Sub Page_Load(ByVal obj As Object, ByVal ea As EventArgs)...
3
by: JimCinLA | last post by:
I use a place holder to load different user controls on an .aspx page. Let's call this default.aspx. Each user controls contains about a dozen different ASP.Net controls. My question is, how...
5
by: gerry | last post by:
I am trying to create a custom container control that will only ever contain a specific type of control. At design time, when a control of a different type is added to the container I would like...
2
by: San24 | last post by:
Guys, Let me explain the application I have - Form > Main Tab Control > Main Tab Page > User Control > Sub Tab Control > Sub Tab Page > User Control > Contols/Text Box. Form - The main...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
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
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.