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
Using FindControl to locate controls in an ASP.Net DetailsView from a VB.Net code-behind file not working
I'm looking to get FindControl to "see" controls in an ASP.Net DetailsView from a VB.Net code-behind file. It doesn't find any of them.
The markup for the page is using a MasterPage.
<%@ Page
Title="Attendance"
Language="vb"
…

Emad-ud-deen
- 4,734
- 21
- 87
- 152
0
votes
1 answer
Update command can't find the correct value of the control
I have created a table in side the edititemtamlate of grid view.
<%-- --%>
…
![]()
Hiral Bavisi
0
votes
2 answers
Returning value from unkown type using FindControl in ASP.NET WebFormsI have created a class that I want to return the selected value from a combo box, checkbox or text box.
The code looks like this:
private string GetControlValue(string controlId)
{
var control = FindControl(controlId);
if…
![]()
Nils Anders
0
votes
2 answers
cant access child control with FindControl()All of this happens within the same user control so that shouldnt make a difference.
![]()
Dragan
0
votes
1 answer
FindControl does not work in a modified DetailsViewControlCollectionThis is probably another case where I am going about it all wrong. I blame myself.
But I am confused by the behavior of FindControl in the DetailsView as shown below.
FindControl works until I remove a field from the DataControlFieldCollection. …
![]()
personaelit
0
votes
1 answer
Access page control in static method when ajax calli call my server side method by jquery and from that method i am trying to access page control but gives error. here is my sample code
[WebMethod]
public static findEvents(string PID)
{
Page page = HttpContext.Current.Handler as…
user1814380
0
votes
2 answers
How to cast to a control found on the pageWorking on ASP.NET app, my project need to find control from page ,use bellow syntax to find control from a page:
public static Control FindControlRecursive(Control Root, string Id)
{
Control FoundCtl = new Control();
if (Root.ID == Id)
…
![]()
shamim
0
votes
3 answers
Object reference not set to an instance of an object #2I have got below error message:
Object reference not set to an instance of an object.
Code-behind:
public partial class Edit : System.Web.UI.Page
{
private TextBox updated_time;
protected void Page_Load(object sender, EventArgs e)
{
…
![]()
Bishan
0
votes
1 answer
TextBox inside Accordion inside Datalist... findcontrol not workingI've searched, but no luck...
I have a textbox inside an accordion control, that's inside a datalist... I want to allow the accordion form to submit some values, but I can't get those values out of the textbox, and findcontrol isn't…
![]()
walstib
0
votes
2 answers
OnCheckedChanged Nested Listview ControlsI have the following nested listview...
![]()
Dooie
0
votes
1 answer
0
votes
2 answers
Can't set the Text property of a control that has been found by Control.FindControl()What I'm trying to do: I'm creating a user through the CreateUserWizard control and I'm trying to set the password to a randomly generated alphanumeric password. The Password TextBox is invisible to the user(an administrator).
My attempted solution:…
0
votes
1 answer
FindControl recursive - error when finding my FileUpload control in GridViewI have been trying the whole day to fix this, hope someone can give me an answer!
(please keep in mind I'm a beginner in this coding).
I have a database where one of the fields is an imageurl. I have to be able to update this field and thought that…
![]()
Matt Baech
0
votes
2 answers
Find header value for a cell in a gridI have gridview, I want to do a foreach on it's rows and get the value from column's header where there's a Label for one cell from this row.
foreach (GridViewRow mainRow in grid1.Rows)
{
var header =…
![]()
Alex
|