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
1 answer
C# Access asp control from Parent page
I have a parent page containing an iframe, an ASP label and a button.
When the user click on the parent button, it will display some table results inside the iframe.
Now i would like to display the parent label with different text and color…

Mélanie
- 31
- 2
- 10
0
votes
2 answers
failing to locate controls from code behind.
I'm having a problem to get controls/ controls id that I have created manually from code behind. after doing research I found if I create the table and its all component including any controls in Page_Init() method, when rendering after postback…

Ashifur rahman
- 74
- 10
0
votes
1 answer
ASP.NET: find control in ListView with ClientId in code behind
My problem was asked to you before but I cannot make it work. I need your help, I think.
" />

Uğur Canbulat
- 11
- 6
0
votes
1 answer
Change Literal text on usercontrol VB.Net
Good day
I have a VB.Net project.
My main page is Display.aspx
I have various usercontrols (ascx) that use this page.
On one of these controls, I have a Literal, lblCatQuestion.
In the code behind of the control
Protected WithEvents lblCatQuestion…

Nicholas Aysen
- 568
- 3
- 18
- 40
0
votes
5 answers
ASP.NET How to access a deeply nested user control on the parent page
I have a login control and at is nested 2 deep in a header control
i.e Page --> Header Control --> Login Control. I cannot get a reference to the control on the page using FindControl. I want to be able to set the visible property of the control…

Brendan
- 1,486
- 3
- 19
- 27
0
votes
1 answer
Tetxtbox inside LayoutTemplate is not taking the changing text in c#
I have two web pages, I send data from one to another using session. From the first web page I get data using session to the second page and set it to the textboxes inside LayoutTemplate as below,
protected void Page_Load(object sender, EventArgs…

shamila
- 1,280
- 6
- 20
- 45
0
votes
1 answer
Set dropdownlist in gridview in rowediting event
Trying to get the findcontrol to work so I can set the default value of the dropdownlist I have in a template field, but I'm having no luck. Am I doing something wrong?
Dim drdList As DropDownList
For Each row As GridViewRow In…

Shawn
- 2,356
- 6
- 48
- 82
0
votes
2 answers
Why does findcontrol need unique id, when I have given it the row to scan
The code
public partial class Table_Traversing : System.Web.UI.Page
{
Table table1 = new Table();
Button button1 = new Button();
protected void Page_Load(object sender, EventArgs e)
{
for…

user287745
- 3,071
- 10
- 56
- 99
0
votes
1 answer
Why findcontrol("x") ASP.NET method can not find a HTML control that made via javascript runtime?
my web page has an optional contact panel that user can add input text for any contact, like cellphone or email,when user click create contact button, it make an input text with attributes like unique id(for example txtrelat1) or runat="server"(in…

mohamadMahmodi
- 11
- 3
0
votes
1 answer
UpdatePanel and refreshing Repeaters
I have a repeater that displays products, and the footer is input fields where you can choose a product from a db and add it to the repeater. The first field of the add line in the footer is a RadComboBox (with product names) and I want to update…

Jordan Wayne Crabb
- 319
- 6
- 17
0
votes
2 answers
FindControl for nested controls in UserControl returns null
I have a very weird issue. I have a UserControl that has some controls inside. I want to refer those controls after, in another postback. But when I try to get them the Controls property of my controls returns null.
I'm working on vs2008.
Here is…

Lug
- 420
- 5
- 15
0
votes
1 answer
ASP.net Cast FindControl output to a parameter
I want to cast the output of FindControl method to a control of a specific type but I want the type itself being passed as an argument. I first tried:
public static List GetList(..., Type tp, ...)
{
...
tp castedCtrl =…

Farshid
- 5,134
- 9
- 59
- 87
0
votes
0 answers
Maintaining state of a control in a repeater in asp.net
I'm having a bit of an issue trying to get a control in a repeater to maintain state.
I have a custom control (KPIbtn) which is basically a 4 position toggle, that I need to keep value between postbacks.
The value is based on a datatable.
To get…

Paul
- 123
- 1
- 7
0
votes
1 answer
How to find Radio button control within Gridview
I am trying to find a radiobutton control within a gridview but I keep getting the output of 0 for whatever radiobutton I select. I want each radiobutton to be assigned the value of 1-4 and then whatever radiobutton selected, it will be outputted to…

SRock2016
- 123
- 1
- 2
- 5
0
votes
1 answer
Null reference when using a variable with findcontrol
I have a .aspx page with several textboxes, including textboxes with IDs of txtID1, txtID2, txtID3... and so on.
I am attempting populate the textboxes with a data from an XML file by looping through a node list. With each loop, I want to use the…

TJM
- 89
- 1
- 10