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
4 answers

findcontrol problems

why can not I do this I have a data list which retrieves some data out. if the label1 is we say 123 then a second label2 must be invisible Label Label1 = (Label)DataList2.FindControl("LabelName1"); Label Label2 =…
saadan
  • 467
  • 1
  • 10
  • 17
0
votes
2 answers

FindControl for finding control on page that uses master page

I have this aspx that uses a master page:
1
Majid
  • 13,853
  • 15
  • 77
  • 113
0
votes
1 answer

can't find control by id during RowDataBound

i created a dynamic gridview and want to assigned the rowdatabound and SelectedIndexChanged to the gridview. below is my code HTML
C# protected void Page_Load(object sender, EventArgs e) { if…
user3431239
  • 267
  • 1
  • 4
  • 20
0
votes
1 answer

Find textbox control in ASP dynamic table

I am dynamically creating a table that contains a textbox. I am doing so with the following code: foreach (DataRow row in Score_Sheet.Rows) // Loop over the rows. { int rowIndex = Score_Sheet.Rows.IndexOf(row); //…
user2219930
  • 125
  • 17
0
votes
1 answer

FindControl table cell

I want to reference a table cell via it's string ID in my code like this FindControl("tdAnswer_a") because I am manipulating string ID names. The ASPX code looks like this : ...
But…
rlb.usa
  • 14,942
  • 16
  • 80
  • 128
0
votes
2 answers

Find Linkbutton in Repeater Itemtemplate when on page load

I'm using a LinkButton in Repeater ItemTemplate but if my LinkButton is NULL then I don't want to show this Linkbutton. Can I control this LinkButton on Page Load?
  • Nilgün
    • 51
    • 2
    • 8
    0
    votes
    1 answer

    How to find the one Label in DataList that is set to True

    In my .aspx page I have my DataList:
    Doug
    • 125
    • 2
    • 11
    • 22
    0
    votes
    1 answer

    ASP.NET Panel FindControl within DataList to change property C#

    I'm new to this ASP.NET stuff. In my page I have a Datalist with a FooterTemplate. In the footer I have a couple panels that will be visible depending on the QueryString. The problem I am having is trying to find these panels on Page_Load to…
    SDC
    • 249
    • 2
    • 7
    • 14
    0
    votes
    2 answers

    How to I get (FindControl) the button of a GridAttachmentColumn in a RadGrid

    I've got a RadGrid with a GridAttachmentColumn named "FileName". I'm trying to get (FindControl) the control out of the GridDataItem in the ItemCreated event. Specifically, I want the button control (or linkButton in this case).…
    Tony L.
    • 17,638
    • 8
    • 69
    • 66
    0
    votes
    3 answers

    ASP.NET C# DataList FindControl & Header/Footer template causes error

    whenever I use the Header or Footer template of DataList, FindControl is unable to find a label part of the DataList, and throws a NullReferenceException. My SQLDataSource and DataList (no Header and Footer template - works): …
    pastapockets
    • 1,088
    • 2
    • 13
    • 20
    0
    votes
    5 answers

    FindControl() from UserControl inside a for loop

    I'm creating a usercontrol that will have a series of LinkButtons. I've declared all of my link buttons at the top of my class LinkButton LB1 = new LinkButton(); LinkButton LB2 = new LinkButton(); //... LinkButton LB9 = new LinkButton(); now I'd…
    Kyle
    • 10,839
    • 17
    • 53
    • 63
    0
    votes
    1 answer

    Find dynamically created controls inside Literal in asp.net page

    Following is my code -- the .aspx file
    -- the .aspx.cs file Literal lit1 = new Literal(); lit1.Text = ""; lit1.Text += "
    user217648
    • 3,338
    • 9
    • 37
    • 61
    0
    votes
    0 answers

    How to find canvas created by for loop in wpf

    I've got function: private string[] Letters = new string[11] {"", "A", "B", "C", "D", "E","F", "G","H", "I", "J"}; private void GenerateGameMap() { int LocA = 5; int LocB = 5; for(int i = 1; i < 12; i++) { …
    Shagohad
    • 365
    • 1
    • 7
    • 23
    0
    votes
    2 answers

    C# ASP.NET FindControl keeps returning null

    I have a TextBox and a Button in my webpage. The user enters a number in the TextBox and clicks the Button, which creates (n+1) TextBoxes in a Panel. As you can see in the code, I have assigned IDs to the TextBox instances , again when trying to…
    cyberpirate92
    • 3,076
    • 4
    • 28
    • 46
    0
    votes
    1 answer

    C# GridView FindControl HTML unordered list

    I want to find an unordered list inside my GridView so that I can hide it based on a condition. I do not know what to cast the object as however. Using HtmlGenericControl does not seem to work. I receive a Object reference not set to an instance of…
    KidBatman
    • 585
    • 1
    • 13
    • 27