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
3 answers
How to access control from parent aspx from its child ascx
I try to access the MainContentBlock control from the aspx, but unable to do so.
In the aspx file I have registered both controls:

eastboundr
- 1,857
- 8
- 28
- 46
0
votes
1 answer
FormView.FindControl works for one form but not the other on the same page
I have two Formviews on the same page. I can use FindControl on the first without issue, but it always fails on the second one.
I am using the ItemTemplate for both, both default to ReadOnly, both are bound to SQLDataSources (different ones) but I…

Matty W
- 65
- 1
- 2
- 8
0
votes
1 answer
Nested DataSource is not found
I have a datasource that needs to gather information for a label. These are both inside of a DataList that is connected to a different DataSource. When I debug my application, the value is Nothing. I thought I had the verbage right since there are…

Jamie
- 1,579
- 8
- 34
- 74
0
votes
1 answer
ASP.NET inline ".FindControl()" in .aspx ListView?
In ASP.NET, we like using "child" SqlDataSource inside a bound grid server control (Girdview or ListView).
I've been using this FindControl() approach for years:
C# Codebehind:
protected void gridviewItems_RowDataBound(object sender,…

A.B. User
- 443
- 1
- 8
- 20
0
votes
2 answers
Could not find control in ControlParameter
My page has a DetailsView that has a hidden field in it that gets referenced by an SQLDataSource to populate a different field in the same DetailsView. I cannot get the codebehind to find the Control, no matter how many different ways I try. I…

Jamie
- 1,579
- 8
- 34
- 74
0
votes
2 answers
Get div control by name from codebehind
Ok, I want to access div control by id witch is changed dynamically from C# code. Maybe it will be clearer with code:
string divHtml = "";
for (int j = 1; j < 4; j++)
{
string ph = "placeHolder" + j;
Control…

Dejan Stuparic
- 575
- 2
- 13
- 32
0
votes
2 answers
Accessing Controls on ListView Edit Command
In my ListView I have an ItemTemplate and EditItemTemplate which look something like this, respectively.
------->
When I click the "Edit" button, and it switches to the EditItemTemplate view on the right, I want to prefill the Textbox and select…

Chiramisu
- 4,687
- 7
- 47
- 77
0
votes
1 answer
findcontrol() oddities in html and asp.net control/elements?
Can anyone offer an explanation as to why the asp:imagebutton gives me a badly formed html error while the html input element does not? I know it's about the findcontrol() in the onclientclick
assignment. They're written in exactly the same format…

Gio
- 4,099
- 3
- 30
- 32
0
votes
3 answers
Repeater Control in Asp.Net?
In web application using asp.net, i am using repeater control, in ItmeCommand event i am trying to find a control using fid control method, i write the code for finding the control it is working fine, when the control is not in repeater control, i…

Surya sasidhar
- 29,607
- 57
- 139
- 219
0
votes
2 answers
Best method to find controls under a dropped usercontrol
I'm trying to implement a drag-drop function to a usercontrol.
I've managed to get this working properly with the use of google, however, when dropping a control I wish to find every similar type controls that might be or might not be under it.
My…

Theun Arbeider
- 5,259
- 11
- 45
- 68
0
votes
1 answer
Finding a dynamically added control in a third nested repeater
I have three repeaters. Lets call them R1, R2 and R3.
In R3, I create a bunch of controls in Page_Init. For example, one of those controls has the name WMC_image.
Im using this code to get…

midnightsyntax
- 409
- 4
- 15
0
votes
1 answer
Can't find my textbox inside a repeater
I am making a menu for a cafe. It shows the food and rinks items, the price and then I want a textbox, where people can write how much of each they want to buy, shown in a textbox. Then I want each textbox to have a unique ID based on the menu items…

Oedum
- 796
- 2
- 9
- 28
0
votes
2 answers
Retrieve value of dynamic radio button controls in asp:table
I am creating radio button dynamically inside asp:table. iI want to get the id of the selected radio button.
How to check the control type
How to get its ID.
RadioButton radioButton = new RadioButton();
radioButton.ID = id + "RadioButton";
…

Geeth
- 5,282
- 21
- 82
- 133
0
votes
4 answers
MVC3 Finding a control by its Name
I have a C#.Net web app and I am trying to access one of the HTML/ASP Text Boxes in the Controller for the Edit View of my Proposal model. In a non-MVC app, I was able to do this using Control.ControlCollection.Find(). Is there an equivalent for a…

MikeTWebb
- 9,149
- 25
- 93
- 132
0
votes
1 answer
find usercontrol that a control resides in
I know that if I have a control, I can do controlobj.FindForm to get a handle on the form it resides in. but is there a similar method to find out the UserControl that a control is in?
thanks
nat

nat
- 2,185
- 5
- 32
- 64