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
2
votes
2 answers
How to read Values from Request.form.Allkeys
I have checkboxes that I have created using Literal now on postback I get the checkboxes which are checked in the Request.form.Allkeys. However I don't know how to read those values how can I use them? how can I count how many values are in there…

Ehsan Kayani
- 113
- 3
- 3
- 7
2
votes
4 answers
Find Control Asp.net
I have created
using literal. Now i want to get this control so i can check if its checked or not. How do I find this control in the aspx.cs page?

Ehsan Kayani
- 113
- 3
- 3
- 7
2
votes
1 answer
FindControl & Change Textbox to Integer?
Im pretty new to this an FindControl is completely confusing me. Can anyone please tell me what the code should be to change the input from the TextBox: txtamount to an integer called 'increment'. I can't even find the control.. I've tried Ctype,…

Eggybread
- 161
- 1
- 12
2
votes
3 answers
Can't find the textbox with FindControl C#
I ran into an issue trying to find a textbox control on the same page. It keeps giving me a null when I debug it.
Here is my code:
public void UpdateTimeLog(string input)
{
string timeNumber = "txtTime" + input;
TextBox…

Ron T
- 397
- 1
- 4
- 22
2
votes
3 answers
How to find label control from content page which is inside master page of user control?
I have one page:Abc.aspx
On this Abc.aspx page i have used one master page that is Master1.Master.
Now on this master page i have rendered 1 usercontrol name as Usercontrol1.ascx.
On this User control i have put 1 label named as lbl1.

I Love Stackoverflow
- 6,738
- 20
- 97
- 216
2
votes
1 answer
Need help using C# FindControl
I have a repeater inside a panel.
Inside this repeater I have another panel.Upon certain conditions, I want to set this panel.visibility = false.
In the code behind, I try locating the panels on OnItemDataBound and set visible=false. But it only…

Steven
- 19,224
- 47
- 152
- 257
2
votes
1 answer
Retrieving keys and NewValues within a Formview with manual data binding
I have a Formview binded in the code file to a generic list. Now, upon editing of a record, I wish to access the Keys and NewValues out of the FormViewUpdateEventArgs parameter of the ItemUpdating event handler method.
From what I've tried and…

Dienekes
- 1,548
- 1
- 16
- 24
2
votes
4 answers
Get DateTime Value from TextBox in FormView
I need to find a value in a TextBox, contained within a FormView which holds a short date.
DateTime LastPayDate = (DateTime)FormView1.FindControl("user_last_payment_date");
I get the error:
CS0030: Cannot convert type 'System.Web.UI.Control' to…

Sanju
- 903
- 5
- 17
- 32
2
votes
2 answers
GridView.Columns.Add vs GridView.Columns.Insert and GirdViewRow.FindControl
I have noticed something that I find weird. Therefore I would like to get an explanation of how it works this way.
I have a GridView, like this:
…

Søren Pedersen
- 764
- 8
- 20
2
votes
1 answer
ASP.NET Repeater template sub-control visibility before databind
I have a custom control which contains a Repeater control. The Repeater has an ItemTemplate. Inside that item template I have a panel which is going to hide something based on "IsEditable" a boolean property of the custom control. What I would like…

William
- 1,457
- 5
- 21
- 46
2
votes
2 answers
find dynamically added controls from container
I am generating dynamic textbox controls on drop down selected index change event.
protected void ddlCategories_SelectedIndexChanged(object sender, EventArgs e)
{
foreach (Attributes attribute in…

Sachin Trivedi
- 2,033
- 4
- 28
- 57
2
votes
0 answers
How to Find a html tag from the repeater in C#?
I am have td in repeater. i want show and hide it on condition
How to Find a html tag from the repeater in C#?
for find button in repeater we write this code
Button btn=Repeater1.FindControl("Button1") as Button;
but for html a tag?
-----…

behnamhaji
- 151
- 7
2
votes
2 answers
Can't find control in code in super class
I have a number of pages
<%@ Page Language="C#" AutoEventWireup="True" CodeBehind="MyPage.aspx.cs" Inherits="MyPage " MasterPageFile="~/Site.master" %>
…

abatishchev
- 98,240
- 88
- 296
- 433
2
votes
1 answer
Can't find a control in repeateritem.findcontrol
I have a nested repeaters in a form and bind them to tables in a dataset. I can find the controls by name and read and set values in the Itemdatabound event, However I can't find the control by the same name in a button click event. I can find the…

Scott
- 23
- 6