Questions tagged [findcontrol]

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.

374 questions
0
votes
2 answers

Access a textbox in C# that is created on fly

My code generates an TextBox on the fly in C# (page_load function). Can I access it in the code later? It does give me compilation error and does not seem to work. Can someone verify ? Code for additonal problem aContent += ""; aContent +=…
TheTechGuy
  • 16,560
  • 16
  • 115
  • 136
0
votes
2 answers

Reference .ASCX from .ASPX dynamically via ID

I've created an .aspx page that consists of many custom .ascx controls and I'd like to create a page function that generates a tool tip for each control. I've created an interface that each .ascx control implements to create the tool tip (the…
0
votes
1 answer

How come FindControl can find a control that doesn't belong to current table row?

I have a table. I need to find all the DropDownList controls in the table. I wrote following code to iterate the table rows to find DropDownList controls. How come in each loop, I could find the DropDownList, even I only have on in row 4? for…
GLP
  • 3,441
  • 20
  • 59
  • 91
0
votes
2 answers

how to hide a checkbox inside a datagrid?

i have datagrid and inside which i have a checkbox . now i want this check to be hidden at page load. my code is :
Ram Singh
  • 6,664
  • 35
  • 100
  • 166
0
votes
2 answers

Find a textbox inside panel which is inside FormView

The formview has more than 1 Panels. My textbox is in the first panel. If I use this TextBox myTxtBox = (TextBox)myformView.Row.FindControl("pnlID").FindControl("mytextbox"); <- does not work Panel mypanel =…
TheTechGuy
  • 16,560
  • 16
  • 115
  • 136
0
votes
1 answer

Can't FindControl when RenderControl ascx in RenderBeginTag while overriding Panel

I'm creating a container using Panel control as follows: public class CustomContainer : Panel { public override void RenderBeginTag(HtmlTextWriter writer) { var control this.Page.LoadControl("web user control path.ascx"); control.ID =…
Ahmed Magdy
  • 5,956
  • 8
  • 43
  • 75
0
votes
1 answer

Find multiple controls in a windows form application using Control.ControlCollection.Find when the name of the control is changing

I am a beginner to c# and windows forms. I want to use Controls.ControlsCollection.Find to find multiple textboxes (present in groupboxes) in the form. (Please note that the groupboxes are loaded dynamically during runtime using a button in the…
Paras
  • 15
  • 4
0
votes
1 answer

Generating button in backend ASP Repeater and then finding the control in c#

So I create a button in the behind code using a function in an Repeater. And then, there's a button that should take these automatically generated buttons (if I check the checkbox in button A, I take the values of row A in repeater,same goes for…
Henry B
  • 29
  • 8
0
votes
2 answers

using string as control id in C# ASP.NET

i have a page with 2 textbox items and a button textbox1 contains a word , and textbox2 is empty now i want to put content of TextBox1.Text in TextBox2.Text with button click, i tried: protected void Button1_Click(object sender, EventArgs e) {…
fateh
  • 7
  • 3
0
votes
1 answer

I can't seem to find the checkbox I put in a gridview for selection of rows

I am working with a gridview which I want to select a row and then put the row in a datatable to bind with a repeater control. I am having trouble finding the selected rows using the checkbox control that I had put in the gridview. I have searched…
0
votes
2 answers

Image.ImageUrl not working (C#, asp.net)

I have the next code: //....and so on till the The code…
Oshrib
  • 1,789
  • 12
  • 40
  • 67
0
votes
1 answer

ListView FindControl error

I have the next error: System.NullReferenceException – Object reference not set to an instance of an object. To the next code:
Oshrib
  • 1,789
  • 12
  • 40
  • 67
0
votes
2 answers

find control in listview

By pressing button in GridView i need to find control in Listview.
RaShe
  • 1,851
  • 3
  • 28
  • 42
0
votes
1 answer

FindControl problem

I have a problem regarding with FindControl.I'm using ASPxRoundPanel(with DXperience component) in a repeater. I have a textbox called "txtAdet ID" in ASPxRoundPanel. I just can't access inside the Textbox.And I got the following the error. "Object…
MaxCoder88
  • 2,374
  • 6
  • 41
  • 59
0
votes
1 answer

Missing something nested in FindControl but always get Null

Literally have read and tried all solutions in Stackoverflow to no avail. I am trying to get the value of different Dropdownlists genereated from a Repeater and another one just generated on the go, plain and simple.
Henry B
  • 29
  • 8