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.

371 questions
3
votes
5 answers

Unable to find control in asp.net Repeater control

This has got me stumped. I am trying to find a checkbox in a dynamically loaded asp.net Repeater template. The template works fine and the databinding is fine and everything displays fine but I can't find the control! Any ideas? This is the repeater…
Dkong
  • 2,588
  • 10
  • 47
  • 71
3
votes
2 answers

getting the values from PreviousPage.FindControl

I'm trying to make a confirmation page for a reservation form. And I'm having trouble getting the value from my previous pages controls. I have everything running at server and I have my submit button's PostBackURL pointing to the confirmation page.…
Andrew-Saarima
  • 270
  • 3
  • 9
3
votes
3 answers

Find control in Web Forms inside a repeater

I'm unable to find a Literal inside a Repeater that is in another UserControl. I have the following UserControl:
3
votes
1 answer

FindControl Not working if its being called from a different Class

On page_Init, I am creating number of UpdatePanels and inside these UpdatePanels one Panel in each. I then use this panel to further go ahead and add other controls dynamically. For example I add number of TextBoxes and Buttons in each of these…
Manish Rajput
  • 43
  • 1
  • 4
3
votes
1 answer

Can't find controls in FormView.InsertItemTemplate even on DataBound event

I have FormView in my page markup:
abatishchev
  • 92,232
  • 78
  • 284
  • 421
3
votes
5 answers

FormView.FindControl() returns null until DataBind()

Why method FindControl() returns null on FormView until call DataBind(). After that it returns everything correctly? What workaround are there? Call DataBind() before first call of FindControl() ?
abatishchev
  • 92,232
  • 78
  • 284
  • 421
3
votes
3 answers

Access Control inside GridView Pager Template - ASP.NET

I am trying to access a LinkButton that is inside a PagerTemplate in a GridView. However, I am getting a NullReferenceException and I don't know what I am doing wrong here. I have tried the…
NullReference
  • 83
  • 1
  • 2
  • 4
3
votes
1 answer

FindControl looks for controls in incorrect template of FormView

How do you locate controls from the codebehind when switching modes in a FormView? It looks like you can't use FindControl during the Page_Load event, since it will be searching for controls in the previously shown template rather than the newly…
Drkawashima
  • 5,996
  • 2
  • 32
  • 44
3
votes
1 answer

populating a text box with FindControl

I have multiple textboxes and I want to programatically populate them with the same method.
Stuart
  • 1,446
  • 5
  • 24
  • 44
3
votes
2 answers

FormView.FindControl(): object reference error

I have a formview that has several textboxes inside of tr/td's. I'm trying to get the textboxes by using the .FindControl method but it's coming back null. The FormView is always in Edit mode (so I'm always in the EditItemTemplate) and i'm trying…
Tone
  • 2,603
  • 6
  • 27
  • 41
3
votes
2 answers

ASP.net .FindControl() and GridView returning null

I have looked over the pages on the site, but cant seem to find something general enough for my problem, so was hoping someone knows what to do. I am debugging some code someone else wrote and am having problems with a GridView statement. My…
user1816892
  • 85
  • 2
  • 8
3
votes
1 answer

How do I get the selected value of a dropdownlist usercontrol located inside of the insertitemtemplate of my formview?

I'm a .NET newbie, but here is my question: I have an application that makes use of Master Pages. I have a page that has a formview on it used to input address information. In the insertitemtemplate is a usercontrol that I am referencing. This…
2
votes
1 answer

how do i reference a listview control that is nested in the itemtemplate of another listview control?

I have a listview control that is nested in the item template of another listview control that i'm trying to reference in codebehind using the .FindControl() method, but it keeps returning null. After get this to work, I'll need to reference a…
Sinaesthetic
  • 9,847
  • 25
  • 95
  • 165
2
votes
4 answers

asp.net/VB.net: FindControl, instead of by ID by ControlType

i need to find a control in a repeater in my asp.net application. At the moment I'm using FindControl("IdOfControl") and this is working well. But I need to find a control by its type (ImageButton). My current code: For Each rptItem As RepeaterItem…
Keith L.
  • 1,974
  • 11
  • 38
  • 64
2
votes
2 answers

Finding user control in TemplateField of DetailsView

I have a DetailsView that I'm posting back - and inside of that is a UserControl. I'm having some difficulty located it in the postback data. As an example:
Khanzor
  • 4,540
  • 2
  • 23
  • 40
1 2
3
24 25