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
Cannot find selected value of dynamically added controls in repeater
I am creating a survey page that has a list of questions and answers that can be radiobuttonlists, checkboxlists or textboxes. These controls are added dynamically to a Repeater in its ItemDataBound event using Controls.Add.
I've managed to render…

Brendan
- 1,486
- 3
- 19
- 27
0
votes
2 answers
gridview findcontrol returning nothing empty string(Blank)
I am trying to pass a session value from a gridview select row using GridView1_RowEditing1 event. i am able to get session value for primarykey (p.key) but the Associate_ID returns empty.
C# Code behind
protected void GridView1_RowEditing1(object…

rakesh
- 326
- 7
- 19
0
votes
2 answers
repeater.findcontrol not working on content page
I have a non content (no master) page with a repeater that performs as I want it to, but when I move the same code to a content page (with master), the findControl in a loop of RepeaterItems no longer works.
aspx:

Dan Wier
- 334
- 5
- 16
0
votes
2 answers
Find dropdown values on user control inside repeater asp.net
I am trying to access DropDownList selected value from user control which is placed inside Repeater's ItemTemplate.
string ddlBeneficiaryTeam2 = ((UserControl_TeamFilter)(rptBeneficiaries.FindControl("ucBeneficiaryTeam"))).TeamSelectedValue;…

kumarjcet
- 419
- 1
- 5
- 8
0
votes
1 answer
How to find the value of a dropdownlist using FindControl?
I am working on a website with VB.NET and ASP.NET. I currently have recurring DropDownLists for the user to provide input.
The design is recurring. These DropDownLists get their values from a database table, Everything with the Web interface is…

Amber Rebecca Howe
- 121
- 2
- 12
0
votes
2 answers
findControl in Naming container (Asp.net webform C#)
I have a problem about findControl method in naming container.
It's not the first trouble about that and I would like understand the theory.
I found many solutions on website but nothing works
I have a DetailsView which contains controls.
I put…

BoumBoumBam
- 35
- 10
0
votes
1 answer
Not getting correct value of textbox from findcontrol from datalist
I am trying to access values of label and textbox inside DataList Using Findcontrol. On running the program I am getting correct value of label but no value from textbox control. Here is the code
.aspx code

TRex
- 365
- 1
- 3
- 10
0
votes
0 answers
Find control of master page working in code behind but not in javascript in content page
I am using vb.net with framework 4.0 ; I am trying to access an asp panel in master page from my content page. In code behind this is working in a button click:
CType(Me.Master.FindControl("PanelMsg"), Panel).Visible = True
Now I am trying to make…

Mlle 116
- 1,149
- 4
- 20
- 53
0
votes
1 answer
Session on Textbox with asp.net and c#
I'am try to make a session on a Textbox in asp.net, that textbox allows the user to enter values from 1-4, but whenever I click on button "book", it gives me an null pointer exception, I am using FindControl function from my c# backend.
Here's my…

Rishik Bajaj
- 31
- 12
0
votes
1 answer
Unable to Find Control in RowEditing event for TemplateFields in GridView
I am adding columns to gridview from codebehind.
For boundfields, i am able to find control and textbox value while updating the row.
But for template fields, i am not able to get controls to the code behind, so i am unable to get the textbox…

siva
- 357
- 4
- 7
- 17
0
votes
1 answer
findcontrol not working for dynamically generated HTMLselect
I generate select control(Q1DDL and Q2DDL) in the innerHTML of a div divQ1AnswerDDLSub in the pageload
The code is perfectly generated as desired.
However, the findControl of ASP.net is not able to find the generated HTMLSELECT control (Q1DDL and…

Shomaail
- 493
- 9
- 30
0
votes
0 answers
findcontrol not able to find a literal control in asp.net
I have aspx page something like this:
And aspx.cs page like this :
protected void Page_Load(object sender, EventArgs e)
{…

Shruti Agarwal
- 887
- 2
- 14
- 29
0
votes
2 answers
How to Findcontrol when we use literal to create it
I am using a panel and then I create a literal in it, than I create :
string temp ="

Ehsan Kayani
- 113
- 3
- 3
- 7
0
votes
2 answers
Unable get Label.text in ASP.Net Repeater using FindControl
I can access the text within a textbox within my repeater, but I am unable to pull the text value from a label within my repeater.
The repeater is populated from a datatable with row(x) being filled by sqlreader(x), I don't know if that makes a…

user331976
- 3
- 1
- 2
0
votes
2 answers
_Setting_ textbox's text using FindControl
I need to be able to set a textbox's (which is inside a gridview row) text to a certain string in runtime. I have used FindControl before, but can't figure out the syntax for actually setting the value of the textbox rather than just getting. Here's…

Chris
- 7,415
- 21
- 98
- 190