473,513 Members | 10,313 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Is there a FindComponent method in CSharp ?

there is a method findcontrol when I use ASP.Net Web app.

But I couldnt find the equivalent of this method in ASP.Net App ?

Is there?

Thanks
Aug 16 '06 #1
3 6040
If you mean for a Form (or any subclass of Control), then in 2.0 the
Controls property (a Control.ControlCollection) has a Find method; this
means you can call:

Control[] found = this.Controls.Find("someName");

This looks recursively, and hence there may be multiple controls with the
same name, hence the array.

If you need 1.1, then I posted some code that did this manually a few days
ago; you would need to port to 1.1 as IIRC it used Queue<T>, so you'd have
to use the non-generic Queue instead.

Marc

Aug 16 '06 #2
Ignore; I saw the first line about web, and (brain freeze) I misread that
the second line was contrasting to a win app. Although, I'm not quite sure
of the difference between an "ASP.Net Web app" and an "ASP.Net App"...

Marc
Aug 16 '06 #3
Hi,

Your post is not very clear, I assume you mean a win app.
If so the answer is "yes" you can use Form.Controls.Find in a similar way
from a web app

The problem may comes from the moment than a control can have no name or two
controls can have the same name in differents context (or maybe even in the
same?).
--
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Coder" <Co***@Coder.Codewrote in message
news:ur**************@TK2MSFTNGP05.phx.gbl...
there is a method findcontrol when I use ASP.Net Web app.

But I couldnt find the equivalent of this method in ASP.Net App ?

Is there?

Thanks

Aug 16 '06 #4

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

Similar topics

2
3367
by: CGuy | last post by:
Hi, I'm trying to implement a custom trace listener. I would like the WriteLine method of this tracelistener to also write out information regarding the method from which Trace was called. For...
3
3769
by: Dennis C. Drumm | last post by:
What is the best way for a modal dialog (windows form) to invoke an unpublicized key combination such as CTRL-ALT-F6? Would it be to set a single key up event for all the controls in the dialog to...
1
3111
by: Ramesh | last post by:
hi, I have created one Component using C#. it have once class name is BusinessObject. In this class i have one method "CreatedRecords". When i make the build it created ComponentName.dll file in...
24
7626
by: Jazper | last post by:
hi i have this problem. i made a class deverted by CRootItem with implementation of IDisposable-Interface. i made a test-funktion to test my Dispose-Method.... but when set a breakpoint in my...
9
2512
by: Cristof Falk | last post by:
I'm using VS.NET 2002 w/C# on one project. I'd like it to, when defining a new method, to automatically put the {} brackets automatically. I prefer having brackets closed before coding. Right now,...
6
3004
by: Alex Sedow | last post by:
Example 1 interface I { string ToString(); } public class C : I { public void f() {
3
2478
by: Jack Addington | last post by:
Is there a quick and easy way in Visual Studio 2003 to get the method declaration from the ancestor so I can override/extend it? I know that if I am in another method or the constructor and type...
3
3633
by: Allan Ebdrup | last post by:
I have a dictionary that I would like to load with data and then have as read only, so I can pass it as a result of a get on a property and not have the recipient of the dictionary change the data...
12
12257
by: | last post by:
Is it fine to call another method from Switch? Eg. Switch (stringVar) { case ("a"): somVar = "whatever"; Another_Method(); //call another method return;
0
7153
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
7373
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
7519
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
5677
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,...
1
5079
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...
0
4743
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3230
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1585
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
452
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.