Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Must we use FindControl?

Reply
Thread Tools

Must we use FindControl?

 
 
Jordan S.
Guest
Posts: n/a
 
      05-22-2008
Is FindControl() really the *only* way to later get a reference to controls
that are dynamically added to a page?

I am currently using ParseControl to insert a bunch of controls into a
WebForm (which is itself dynamically inserted into the page).

In subsequent code I do in fact know the ID of one of the controls added
earlier via ParseControl. I would like to get a reference to that control
via it's ID (perhaps qualified by it's naming container) and not have to use
FindControl. But from all the googling I have done, it appears that my only
alternative is to use FindControl - which is expensive and, IMHO unnecessary
given that I already know the naming container in which the control exists.

Do I have any alternatives to FindControl() ?

Thanks.



 
Reply With Quote
 
 
 
 
bruce barker
Guest
Posts: n/a
 
      05-22-2008
no. you could save a reference to the control when you create it. if you
don't do this then findcontrol is you only option. it just loops thru the
naming container controls collection looking for a control with the specified
id.

-- bruce (sqlwork.com)


"Jordan S." wrote:

> Is FindControl() really the *only* way to later get a reference to controls
> that are dynamically added to a page?
>
> I am currently using ParseControl to insert a bunch of controls into a
> WebForm (which is itself dynamically inserted into the page).
>
> In subsequent code I do in fact know the ID of one of the controls added
> earlier via ParseControl. I would like to get a reference to that control
> via it's ID (perhaps qualified by it's naming container) and not have to use
> FindControl. But from all the googling I have done, it appears that my only
> alternative is to use FindControl - which is expensive and, IMHO unnecessary
> given that I already know the naming container in which the control exists.
>
> Do I have any alternatives to FindControl() ?
>
> Thanks.
>
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why must and must not be "final" ? NeoGeoSNK Java 25 11-24-2006 02:02 AM
Operation must use an updateable query Error!!! =?Utf-8?B?S2Vu?= ASP .Net 6 02-13-2004 03:45 PM
use client side code to trigger the load of page must use GET Protocol? Matt ASP General 1 01-18-2004 04:09 AM
Operation must use an updatable query - user problem Mr. x ASP .Net 1 11-06-2003 02:52 PM
Operation must use an updateable query error. abdul haleem ASP .Net 3 10-19-2003 05:53 PM



Advertisments