FindControl

I know using FindControl in ASP.NET is not always as easy as it would seem on the surface. Particularly when you start looking for controls inside of a DataGrid or a Repeater. This article should help out.

Print | posted @ Sunday, April 25, 2004 3:36 AM

Comments on this entry:

Gravatar # re: FindControl
by Sathya at 3/17/2005 9:14 AM

ads
  
Gravatar # re: FindControl
by T at 5/9/2005 8:18 PM

ttt
  
Gravatar # re: FindControl
by MouseSkip at 8/23/2005 2:35 AM

good article
  
Gravatar # re: FindControl
by daryl at 1/19/2006 12:34 PM

I looked at this code and the comments.
I have an issue where I am using template columns and when a link button is clicked I run some code:
Dim txtIPTC As TextBox = CType(DataGrid1.Items(DataGrid1.SelectedIndex).FindControl("txtIPTC"), TextBox)

Problem is that datagrid1.selectedindex, always returns -1

anyway around this?
  
Comments have been closed on this topic.
Scott Allen
Posts - 869
Comments - 4493
Stories - 14