0
votes

this is driving me crazy.

I have a User Control that works right. On one of it's click events, I call (Label)this.Parent.FindControl("lblRequestNumber"); and it works ok, returning the label that I want. However I have another user control that needs to access the same label. This user control renders inside of one of the columns of a gridview inside the same parent page. This time, (Label)this.Parent.FindControl("lblRequestNumber"); returns null.

Why?? How can I access controls of the parent page, from a user control within a gridview row??

1

1 Answers

0
votes

I found the solution. I needed to call "parent" a couple of times in order to get out of the GridView and find the control inside the parent page.