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

Find sibling control in Repeater

I have a Repeater structured something like this:
Turnip
  • 35,836
  • 15
  • 89
  • 111
0
votes
2 answers

Changing style inside Login

I have a problem changing the style of my UserName TextBox inside of asp:Login. It seems like my code never actually finds the textbox because the style dosen't change at all. Following code example:
ro0t
  • 1
0
votes
0 answers

Can't get Control with FindControl()

I am using a MasterPage site. in default.aspx code-behind, Page_Load event, i create many container DIV (ie. each DIV is a SQL result): HtmlGenericControl div = new HtmlGenericControl("div"); div.Attributes.Add("id", "div_" + postid); Then create…
Dillinger
  • 341
  • 3
  • 16
0
votes
1 answer

Get Page control in a Method triggered by AJAX call

I call a method in a separate Class file that needs to update a label. [WebMethod] //needed for the AJAX call public static void MyClick(int postid, int userid) //must be static { Page page = new Page(); //Page page =…
Dillinger
  • 341
  • 3
  • 16
0
votes
1 answer

FindControl throwing null exception

I am trying to dynamically create a div within the tab_content which is also a div.. then I am trying to check if the current row + "_tab_content" is equal to any ID within the tab_content, if so then do something. For example the…
mogorilla
  • 195
  • 2
  • 13
0
votes
2 answers

FindControl CodeBehind Issue

I have the following code in my aspx file: When I click a submit button: The…
Jonathan
  • 147
  • 1
  • 2
  • 10
0
votes
2 answers

How to FindControl() in a GridView while in Edit mode?

I want to access controls and update database with their value. Notice using following code: void grdList_UpdateCommand(object source, GridCommandEventArgs e) { string str = ((RadTextBox)e.Item.FindControl("txtLookupItemValue")).Text; } I…
Afshar Mohebi
  • 10,479
  • 17
  • 82
  • 126
0
votes
1 answer

How can use FindControl in the OnRowCommand of GridView?

I am trying to use findcontrol TextBox in RowCommand of the gridview. But Error Object reference not set to an instance of an object. Help me please. Design
nettoon493
  • 17,733
  • 7
  • 30
  • 45
0
votes
1 answer

Finding Control return Null

I have a control that add dynamically in pnRoom (panel) ImageButton imgbtn = new ImageButton(); imgbtn = new ImageButton(); imgbtn.Height = 25; imgbtn.CssClass = "bulb"; imgbtn.ID = i++; pnRoom.Controls.Add(imgbtn); And i'm received null…
huy cao
  • 28
  • 8
0
votes
1 answer

How do I find a dynamically added TableLayoutPanel control in tab control of a winform

Need help finding a TableLayoutPanel added at run time to a tab control of a winform. Please find example code below. Any help would be appreciated. private void GenerateControls() { TableLayoutPanel tp = new TableLayoutPanel(); tp.Name =…
Paul
  • 93
  • 2
  • 11
0
votes
1 answer

How to get value from a listview Asp.Net

I have a listview in asp.net like this:
Murtaza Munshi
  • 1,065
  • 4
  • 13
  • 40
0
votes
2 answers

TableCell.FindControl Seems to Find my Control In Cells Where it Does Not Exist

I have a simple asp net page: I design a gridview with custom header and item template. Then i bind it, and i'd like to use findcontrol to find a control in header section. I do not get error, but findcontrol seems to find may control in every…
maleda
  • 1
  • 2
0
votes
2 answers

asp.net change format on various fields with same prefix, different suffix

I have the following VB code in an asp.net page. It works fine, however I am sure there must be a better way (one only line perhaps) to cover all 6 fields within the block. As you can see there are 4 rows of fields, each row contains 6 fields. Their…
user1135218
  • 393
  • 1
  • 8
  • 26
0
votes
0 answers

Issue with FindControl on the second page of GridView

I'm using Gridview + Datatables js for paging. I would like to loop through the gridview rows in the back end, but it seems like I can't use row.FindCountrol method to find a HiddenField control on the rows that are currently not displayed (i.e.…
IgorShch
  • 149
  • 1
  • 4
  • 21
0
votes
2 answers

FindControl returns empty textbox object / null

I have a html table on a page:
Safety
nickson104
  • 580
  • 1
  • 7
  • 18