A method on the Control class in the .NET framework that finds a control from its id. The control is only found if it is within the calling control's naming container.
Questions tagged [findcontrol]
374 questions
0
votes
4 answers
findcontrol problems
why can not I do this
I have a data list which retrieves some data out. if the label1 is we say 123 then a second label2 must be invisible
Label Label1 = (Label)DataList2.FindControl("LabelName1");
Label Label2 =…

saadan
- 467
- 1
- 10
- 17
0
votes
2 answers
FindControl for finding control on page that uses master page
I have this aspx that uses a master page:
0
votes
1 answer
can't find control by id during RowDataBound
i created a dynamic gridview and want to assigned the rowdatabound and SelectedIndexChanged to the gridview.
below is my code
HTML
C#
protected void Page_Load(object sender, EventArgs e)
{
if…

user3431239
- 267
- 1
- 4
- 20
0
votes
1 answer
Find textbox control in ASP dynamic table
I am dynamically creating a table that contains a textbox. I am doing so with the following code:
foreach (DataRow row in Score_Sheet.Rows) // Loop over the rows.
{
int rowIndex = Score_Sheet.Rows.IndexOf(row); //…

user2219930
- 125
- 17
0
votes
1 answer
FindControl table cell
I want to reference a table cell via it's string ID in my code like this FindControl("tdAnswer_a") because I am manipulating string ID names. The ASPX code looks like this :
...
But…
![]()
rlb.usa
0
votes
2 answers
Find Linkbutton in Repeater Itemtemplate when on page loadI'm using a LinkButton in Repeater ItemTemplate but if my LinkButton is NULL then I don't want to show this Linkbutton. Can I control this LinkButton on Page Load?
![]()
Nilgün
0
votes
1 answer
How to find the one Label in DataList that is set to TrueIn my .aspx page I have my DataList:
![]()
Doug
0
votes
1 answer
ASP.NET Panel FindControl within DataList to change property C#I'm new to this ASP.NET stuff. In my page I have a Datalist with a FooterTemplate. In the footer I have a couple panels that will be visible depending on the QueryString. The problem I am having is trying to find these panels on Page_Load to…
![]()
SDC
0
votes
2 answers
How to I get (FindControl) the button of a GridAttachmentColumn in a RadGridI've got a RadGrid with a GridAttachmentColumn named "FileName". I'm trying to get (FindControl) the control out of the GridDataItem in the ItemCreated event. Specifically, I want the button control (or linkButton in this case).…
![]()
Tony L.
0
votes
3 answers
ASP.NET C# DataList FindControl & Header/Footer template causes errorwhenever I use the Header or Footer template of DataList, FindControl is unable to find a label part of the DataList, and throws a NullReferenceException.
My SQLDataSource and DataList (no Header and Footer template - works):
…
![]()
pastapockets
0
votes
5 answers
FindControl() from UserControl inside a for loopI'm creating a usercontrol that will have a series of LinkButtons.
I've declared all of my link buttons at the top of my class
LinkButton LB1 = new LinkButton();
LinkButton LB2 = new LinkButton();
//...
LinkButton LB9 = new LinkButton();
now I'd…
![]()
Kyle
0
votes
1 answer
Find dynamically created controls inside Literal in asp.net pageFollowing is my code
-- the .aspx file
-- the .aspx.cs file
Literal lit1 = new Literal();
lit1.Text = "
|