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
0 answers
LinkButton in GridView does not fire RowCommand
I am dynamically building a datatable and binding it to a gridview in a VB codebehind. I transform the gridview cell data into LinkButton controls to allow that data to be clicked for updates.
I am using AjaxControlToolkit to present a modal popup…

cltdiver
- 83
- 1
- 1
- 7
0
votes
1 answer
Function FindControl is not working
I'm trying to get the value of dynamically created textbox.
Dim idReponse As String
idReponse = GlobalVariableAddOneWeight.ArrayReponseId(i)
Dim textboxId As String
textboxId = "txtWeight" + idReponse
Dim tb As New TextBox()
tb =…

user2550171
- 23
- 1
- 2
- 8
0
votes
1 answer
How to move ASP.NET PlaceHolder control from Page controls collection to a custom Control's output?
I am writing an ASP.NET custom control.
In my custom control code, I find a PlaceHolder control in the page like so:
this.myPlaceholder = Page.FindControl("placeholder1") as PlaceHolder;
Then, I render the placeholder as the output of the custom…

frankadelic
- 20,543
- 37
- 111
- 164
0
votes
3 answers
ASP VB.NET - FindControl isn't finding my control
A little background. There is a masterpage as well. Here is the ASPX code
Please review the items below and enter the quantity of each item for which you are requesting…

user3542850
- 23
- 6
0
votes
1 answer
Findcontrol for label in gridview using javascript
I have a gridview which has some templatefield. At cell5 i have a label which is the input for database. but not all the labels in all the rows contains the value. its based on the click event of an editTemplateField. I have vb.net code for…

King of kings
- 695
- 2
- 6
- 21
0
votes
0 answers
Changed Screen Orientation MediaElement Disappear From Screen
I have interesting problem for my project. I m working on orientation of the app and my problem is that my videoelement is disappered when i changed my screen orientation portrait or landscape. I m using same code for my Image and it is working…

SilverSharK
- 37
- 4
0
votes
0 answers
Getting Gridviews Values in Session Variable
I am trying to store values from a gridview to session variables, using a button in Gridview, which is placed in an Content Page and further in an accordion, so first I have to find contentplaceholder which have done nicely, 2ndly I find accordion…
0
votes
1 answer
Will this code get the value of the found control? asp.net syntax
x.Parameters.AddWithValue("@areasexpertise1", FindControl("AreasExpertise1"))
It should find AreasExpertise1 and make a parameter, but does that get the selectedvalue too?

Phil
- 1,811
- 9
- 38
- 60
0
votes
1 answer
Find Control Deep Inside LoginView
I have a login view control that I can find with findcontrol. Inside it is LoggedInTemplate->ul->li->ul->li->a. How can I find a? Here is sample code:
…

AM0
- 165
- 2
- 4
- 20
0
votes
2 answers
FindControl not finding child control on postback
This has me baffled because the same FindControl code finds the control when it's not a postback. Here's the situation.
I have a custom control (ClassCell.ascx). It has a LoginView that shows a link only for people in a particular…

Sandra
- 608
- 2
- 11
- 23
0
votes
1 answer
"RequiredFieldValidator" FindControl in GridView
My intention is diseable RequiredFieldValidator in grid view row. To find this validator i'am using FindControl method. I wrote this code:
protected void GridView2_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName ==…

Shagohad
- 361
- 1
- 10
- 20
0
votes
1 answer
Listview DropDownList FindControl without Edit Button
I am having trouble populating a dropdownlist from a dataset when the dropdownlist is embedded in a listview. I get "Object reference not set to an instance of an object." because, I believe, I am not accessing the dropdownlist correctly using…

user3182970
- 25
- 3
0
votes
2 answers
asp.net VB Findcontrol cannot find control outside of formview
I am creating a DNN page that has a formview. The sqldatasource is on the outside of the formview. I need to control the sqldatasource.insert() call from the codebehind. (there are 2 buttons - 1 which inserts and goes to one page, 1 which inserts…

Joe
- 26
- 4
0
votes
3 answers
Accessing data in RowCommand
Im new to C# and in VB i could do the following:
Protected Sub DataGrid1_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles DataGrid1.ItemCommand
If e.CommandName = "CommandName" Then
…
user147215
0
votes
2 answers
How to find a control in a repeater with IndexOf C#
I want to know if it's possible to find a control in a repeater but by approximation. I mean, I have some controls with end "....EditMode" and I want to catch them all and modify some attribute
Something like this
foreach(RepeaterItem item in…

Maximus Decimus
- 4,901
- 22
- 67
- 95