I have this structure :
Page
|
+---Ascx
|
+---<div runat="server">
|
+---<asp:button>
I already know that Findcontrol
doesn't work recursively .
However when I pressed the button and went to debug and wrote :
this.FindControl("btn1")
it did find the "button"
But
this
= the ascx- There is a
div runat server
which wraps the button
So how did it find it ? According to the definition , it doesn't suppose to work.
Msdn :
Control.FindControl --> The method does not search throughout a hierarchy of controls within controls