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
2
votes
1 answer
How to find a control by ClientID in c# .net?
I'm trying to write a generic function that scours all the form-input controls inside a given parent so that I can repopulate the form's values at a later time.
I store each control's ID and VALUE in a cookie, and I repopulate the controls by using…

Bumpy
- 1,290
- 1
- 22
- 32
2
votes
1 answer
how to add controls to the masterpage's content placeholder programmatically
On the base.master:
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Base.master.cs" Inherits="WebApplicationControlTest.Base" %>

Jronny
- 2,164
- 4
- 30
- 41
2
votes
1 answer
Change text of a linkbutton in a repeater
I have a repeater which displays comments related to a post.
I want to add some functionality where when the user click on the link it goes from:
report this post
to
post has been flagged
how do I access the specific lnkButton? Obviously in…

Jack Marchetti
- 15,536
- 14
- 81
- 117
2
votes
2 answers
change id of a server control in asp.net
Hai guys,
I used find control to find a list item of an unoreder list inside a master page from content page using this,
Control home = this.Page.Master.FindControl("list").FindControl("home");
Now i have to change the id of the control home to…

ACP
- 34,682
- 100
- 231
- 371
2
votes
1 answer
Can not find a control using the FindControl on RowCreated for Gridview
I am using a gridview, and here is one of my templatefields:
…

HOY
- 1,067
- 10
- 42
- 85
2
votes
1 answer
value of private variable is not maintained after page load even in ASP.NET
I have two pages. first.aspx and second.aspx. In order to get all the control values from first.aspx, i added directive to second.aspx
<%@ PreviousPageType VirtualPath="~/PR.aspx" %>
I have no problem to get all the previous page controls and set…

John
- 190
- 1
- 4
- 15
2
votes
1 answer
Get the Value of a Programmatically added TextBox using FindControl in a Loop
I have a GridView that's bound to a DropDownList. The GridView is updated by a SQL query when the DropDownList's index is changed. Values in the GridView's Cells are turned into Labels and a TextBox is programmatically added. OnClick of a button…

apogee82
- 23
- 4
2
votes
2 answers
LightSwitch - getting an AutoCompleteBox with FindControl, becomes null on cast
I'm trying to access an AutoCompleteBox on one of my screens. I can see that FindControl() has located the control when I do var testControl = FindControl("MyControl");
However, when I attempt to cast this to the type of control it is supposed to…

Interminable
- 1,338
- 3
- 21
- 52
2
votes
1 answer
Gridview RowUpdating can't find a control
As the title says I am unable to find the control I want.
This is the GridView:

Rambomst
- 653
- 2
- 10
- 28
1
vote
2 answers
FindControl cannot find the label control
I have a DataList inside a DataList that causes my page to lose the controls. The page works and there are no errors, but my label is never found! This is odd because the label shows on the aspx page, it just doesn't remove the 2 items that I want…

Jamie
- 1,579
- 8
- 34
- 74
1
vote
1 answer
Unable to cast HiddenField to I.Convertible
I have 2 DataLists where one is nested in the other one. I have one line (Dim QID....) that keeps giving me problems, no matter what combination of code I can find online. I just want to be able to get the Hidden Field to show up as an integer so…

Jamie
- 1,579
- 8
- 34
- 74
1
vote
1 answer
Losing controls on changeMode?
I'm doing some database manipulation with .NET, using a detailsView of a child element with a hidden field in insert mode to store the parent's ID. It's populated as:
dvChild.ChangeMode(DetailsViewMode.Insert);
HiddenField hdParentId = (HiddenField)…

Glazius
- 729
- 7
- 28
1
vote
1 answer
Is it possible to find a control in a XAML (Silverlight) using wildcard?
Is it possible to find a control in a XAML (Silverlight) using wildcard?
Ex.. in my XAML

mercu
- 121
- 2
- 16
1
vote
2 answers
Find a textbox inside repeater inside another repeater
I have made a menu list. It consists of two repeater, one with the productType and the other with the content of that product type.
It is possible to enter how many of the content you want in a text box and I now want to find the textbox and its…

Oedum
- 796
- 2
- 9
- 28
1
vote
1 answer
how to check the checkbox inside the repeater at binding time accordingto value?
I have a repeater and inside it i have a checkbox. Now i want to check it according to columns value(0/1). I have tried it through the itemDataBound event of the repeater. what its doing if the rows has value 1 then its checked all checkbox and if…

Ram Singh
- 6,664
- 35
- 100
- 166