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
Find sibling control in Repeater
I have a Repeater structured something like this:

Turnip
- 35,836
- 15
- 89
- 111
0
votes
2 answers
Changing style inside Login
I have a problem changing the style of my UserName TextBox inside of asp:Login.
It seems like my code never actually finds the textbox because the style dosen't change at all.
Following code example:

ro0t
- 1
0
votes
0 answers
Can't get Control with FindControl()
I am using a MasterPage site. in default.aspx code-behind, Page_Load event, i create many container DIV (ie. each DIV is a SQL result):
HtmlGenericControl div = new HtmlGenericControl("div");
div.Attributes.Add("id", "div_" + postid);
Then create…

Dillinger
- 341
- 3
- 16
0
votes
1 answer
Get Page control in a Method triggered by AJAX call
I call a method in a separate Class file that needs to update a label.
[WebMethod] //needed for the AJAX call
public static void MyClick(int postid, int userid) //must be static
{
Page page = new Page();
//Page page =…

Dillinger
- 341
- 3
- 16
0
votes
1 answer
FindControl throwing null exception
I am trying to dynamically create a div within the tab_content which is also a div.. then I am trying to check if the current row + "_tab_content" is equal to any ID within the tab_content, if so then do something.
For example the…

mogorilla
- 195
- 2
- 13
0
votes
2 answers
FindControl CodeBehind Issue
I have the following code in my aspx file:
When I click a submit button:
The…

Jonathan
- 147
- 1
- 2
- 10
0
votes
2 answers
How to FindControl() in a GridView while in Edit mode?
I want to access controls and update database with their value. Notice using following code:
void grdList_UpdateCommand(object source, GridCommandEventArgs e)
{
string str = ((RadTextBox)e.Item.FindControl("txtLookupItemValue")).Text;
}
I…

Afshar Mohebi
- 10,479
- 17
- 82
- 126
0
votes
1 answer
How can use FindControl in the OnRowCommand of GridView?
I am trying to use findcontrol TextBox in RowCommand of the gridview.
But Error Object reference not set to an instance of an object.
Help me please.
Design

nettoon493
- 17,733
- 7
- 30
- 45
0
votes
1 answer
Finding Control return Null
I have a control that add dynamically in pnRoom (panel)
ImageButton imgbtn = new ImageButton();
imgbtn = new ImageButton();
imgbtn.Height = 25;
imgbtn.CssClass = "bulb";
imgbtn.ID = i++;
pnRoom.Controls.Add(imgbtn);
And i'm received null…

huy cao
- 28
- 8
0
votes
1 answer
How do I find a dynamically added TableLayoutPanel control in tab control of a winform
Need help finding a TableLayoutPanel added at run time to a tab control of a winform. Please find example code below. Any help would be appreciated.
private void GenerateControls()
{
TableLayoutPanel tp = new TableLayoutPanel();
tp.Name =…

Paul
- 93
- 2
- 11
0
votes
1 answer
How to get value from a listview Asp.Net
I have a listview in asp.net like this: