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

Find Control in javascript by using variable

i have to Hide/Unhide panel of asp web form by javascript. pls Help for (var l = 1; l <= ddlSizesValue; l++) { var Size = "pnlProduct1Design1Color1Size" + l; var pnl = document.getElementById('pnlProduct') var pnlSize =…
Umair
  • 31
  • 6
0
votes
1 answer

How to get checkboxid which is placed inside the repeater control from the codebehind side?

Let us assume sample.aspx is a page this page contails the following Repeater
0
votes
1 answer

My find control isn't finding a label in gridview item template, any ideas how can I fix this?

I am trying to attach a value to a label on my gridview using the same technique that I have used many times, even in this very page, but the find control isn't finding the label. Does anyone know why this might be? From the research that I've done…
0
votes
3 answers

FindControl in ASCX UserControl

I am trying to find a control a DIV that I have set to runat server in my ascx file, but when I debug it, I get the value of findcontrol is null so its not finding it, what am I doing wrong? This being called from my ASPX page: …
atrljoe
  • 8,031
  • 11
  • 67
  • 110
0
votes
1 answer

How to FindControl on content page from dynamic User Control

I am getting a null reference exception when trying to FindControl on a button. I have a shopping cart setup where I have a content page (.aspx) based on a master page. On the content page, there is a placeholder control in which I am dynamically…
0
votes
1 answer

populating asp dropdown under telerik gridview from a datasource

I have been trying to add a dropdown control in a column of a telerik grid view. Below is the code snippet. when I use the Find Control on dropdown, it returns null and the data is not bound. ASP
0
votes
1 answer

FindControl returns null in MasterPage

I have a nested DataList in MasterPage. I'm trying to Findcontrol, but it returns null for DataList2. What I tried so far : DataList DataList1 = Page.Master.FindControl("DataListMain") as DataList; DataList DataList2 =…
Bengi Besçeli
  • 3,638
  • 12
  • 53
  • 87
0
votes
2 answers

FindControl doesn't work with my ChangePassword control

How can I access to the CancelPushButton ? This doesn't work ! it returns always null !! var cancelButton = ChangeUserPassword.FindControl("CancelPushButton"); ASP.Net code:
Homam
  • 23,263
  • 32
  • 111
  • 187
0
votes
2 answers
0
votes
1 answer

Access User Control DataGrid Controls from parent page

here my code- GridView gvCondition = (GridView)this.FindControl("ucCondition").FindControl("gvCondition"); gvCondition.DataSource = objConditionFieldCollection; gvCondition.DataBind(); but it is throwing as exception Object reference not set to an…
ppp
  • 303
  • 2
  • 9
  • 22
0
votes
3 answers

asp.net object reference not set error

I am trying to find the label control from aspx page. Label labelmessageupdate; labelmessageupdate = (System.Web.UI.WebControls.Label )FindControl("updateMessage1"); if i set labelmessageupdate.Text ="something" it returns object…
sam
  • 107
  • 1
  • 4
  • 15
0
votes
0 answers

ASP.NET/C#: Retrieving listview value and passing to C# via a checkbox

I've seen various solutions to this on here, but for some reason it isn't working for me. Basically on the client side I'm generating Listview elements from a database and want to retrieve the value generated in the "catlbl" label value and pass to…
DSchwartz
  • 1
  • 1
0
votes
2 answers

asp.net how to use findControl to get div inside a repeater

I have a div inside a repeater, its id is the id get from a record from a datasource
"> What I'm trying to do is changing the background color of some of this divs (through a query that looks for specific data), I tried…
0
votes
3 answers

findcontrol textbox text without declaring variable c#

Is there a way to turn these two lines of code into a single line of TextBox tempTextBox= grdvwEncroachmentsID.Rows[e.RowIndex].FindControl("txtbxBillTo") as TextBox; string billToTemp = tempTextBox.Text;
kevorski
  • 816
  • 1
  • 11
  • 29
0
votes
4 answers