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
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
  • 91
  • 1
  • 3
  • 10
0
votes
2 answers

Returning value from unkown type using FindControl in ASP.NET WebForms

I 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
  • 4,212
  • 5
  • 25
  • 38
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
  • 3,713
  • 12
  • 42
  • 59
0
votes
1 answer

FindControl does not work in a modified DetailsViewControlCollection

This 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
  • 1,633
  • 3
  • 31
  • 59
0
votes
1 answer

Access page control in static method when ajax call

i 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 page

Working 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
  • 6,640
  • 20
  • 85
  • 151
0
votes
3 answers

Object reference not set to an instance of an object #2

I 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
  • 15,211
  • 52
  • 164
  • 258
0
votes
1 answer

TextBox inside Accordion inside Datalist... findcontrol not working

I'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
  • 63
  • 10
0
votes
2 answers

OnCheckedChanged Nested Listview Controls

I have the following nested listview...
Dooie
  • 1,649
  • 7
  • 30
  • 47
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 GridView

I 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
  • 404
  • 11
  • 23
0
votes
2 answers

Find header value for a cell in a grid

I 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
  • 8,908
  • 28
  • 103
  • 157
0
votes
1 answer

Finding a label using FindControl within an AJAX Accordion Control

I have an AJAX Accordion control defined in the page and within each accordion branch I have a label that gets its value from SQL database
Dogahe
  • 1,380
  • 2
  • 20
  • 50
1 2 3
24
25