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

C# GridViewRow FindControl get/pass values

I have an asp:linkbutton. When it's pressed I want to get a list of DetailID's based on which of the checkboxes in my GridView are checked. I have a lblTesting to see the list of DetailID's that I'm generating. My goal is to get a list of…
0
votes
2 answers

Gridview cannot parse input string is not correct

Essentially trying to capture information when a checkbox is checked off, if it is then capture the quantity inputted. Attached is the code.
0
votes
0 answers

PostBackTrigger for nested control

I have an UpdatePanel which contains all my page (I know, not an ideal solution), and I have some Panel's contained in this. Inside one is a control which I want to be a PostBackTrigger, but whenever I reference the button I get object reference…
Chris
  • 7,415
  • 21
  • 98
  • 190
0
votes
1 answer

Find the value in gridview using findcontrol and comapre it with data in database

protected void LinkButton_Click(Object sender, EventArgs e) { String MyConnection2 = "Server=localhost;database=ovs;Uid=root;password=; Convert Zero Datetime=True"; DateTime time = DateTime.Now; // Use current time …
Kekw Yc
  • 5
  • 4
0
votes
2 answers

Error: Object reference not set to an instance of a object, while getting a label value using findcontrol which in listview

Object reference not set to instance of an object, this error I'm getting when I click the linkbutton. The code bind file contain the below code for click event. protected void viewProfileLinkButton_Click(object sender, EventArgs e) { …
Puneeth K G
  • 15
  • 3
  • 9
0
votes
1 answer

Unable to get Checkbox ID or Checked status from Control inside a Repeater

I am converting a Classic ASP program to C#/asp.net and I don't have a lot of freedom to change displayed code because of customer requirements. To duplicate the legacy codes appearance, i used a Repeater, like so:
pmcs
  • 51
  • 1
  • 10
0
votes
1 answer

how to update label value from jquery modal popup in asp.net

I have a page, product.aspx. Inside this page I have a label that shows the count of products added to basket. I also have viewcart.aspx page to show my cart item and edit or delete product. Everything is well but when I delete a product from…
hesam salehnamadi
  • 199
  • 1
  • 1
  • 16
0
votes
2 answers

how to search a control in an asp.net gridview and access it?

I have a gridview as :
NayeemKhan
  • 1,210
  • 7
  • 19
  • 38
0
votes
2 answers

set imagebutton in detailsview visible after control on other field

I have this detailsview in which I have a field and an imagebutton. If the value of the field is empty i'd like to set the imagebutton invisible and if it's not empty I'd like to see the imagebutton. Here's my code: //for (int i = 0; i <…
Dieter
  • 401
  • 1
  • 9
  • 31
0
votes
0 answers

Insert Grid View column value into Textbox and dropdown on button control

I want to Fill gridview column value into given control something like Project Title value fill inside project Title text box Problem ID fill inside Selected Problem Dropdown and so on... on button click even i have taken as control name Project…
Nits Patel
  • 380
  • 3
  • 15
0
votes
1 answer

Traverse upwards through nested ajax accordion web controls; Type checking and FindControl

I have nested ajax accordion web controls (nested 3 deep or sometimes 4 deep) and I am trying to find a nested accordion's parent accordion. I want to do this when either of the deep-most accordions becomes databound. protected void…
BumbleB2na
  • 10,723
  • 6
  • 28
  • 30
0
votes
0 answers

How to find a master page list control using its id on master page iitself and add attribute to it?

I'm trying to add href attribute to list controls in master page in the page load function based on the type of person logged in the website. 1.first step is to make a call to database to get name of the form,module of the form(i.e, in which…
Mos
  • 11
  • 1
  • 4
0
votes
4 answers

FindControl suddenly returning object reference error (ASP.NET/C#)

I have the following code in my Global.asax file: System.Web.UI.Page webPage = (System.Web.UI.Page)System.Web.HttpContext.Current.Handler; string date = ((Literal)webPage.FindControl("ltlGenTime")).Text; The control definitely exists on the…
Chris
  • 7,415
  • 21
  • 98
  • 190
0
votes
0 answers

Find Control returning null

When I try to find a control on the current page, it returns null every time and the control is right there. HTML: Code Behind HtmlInputRadioButton control =…
Walters
  • 119
  • 16
0
votes
1 answer

DataGridItem.FindControl doesnt find the control? (ASP.NET)

Label lbl = dgi.FindControl("LBL_MyLabel") as Label; This works most of the time, but sometimes lbl is null after FindControl was called. I am wondering how this could happen. It should either be there or not? Any ideas? The label is defined like…
grady
  • 12,281
  • 28
  • 71
  • 110