G
Guest
Hi There,
I have a usercontrol that presents the majority of a page's content. Within
the ASP.NET application it appears as XXXX.PageControl, where XXXX is the
namespace of my project. There will only ever be one and onely one of these
controls per page. I want to identify the control and set a particular
property depending upon what the current page is.
I want to find this control generically, so I wrote the following code:
for each ctl as control in me.controls
if ctl.GetType is GetType(PageControl) Then
....
exit for
end if
next
But this is never true. If I examine what is returned by
ctl.GetType.ToString, I see "ASP.PageControl_ascx".
Any advice on how to get this comparison working would be appreciated!
Cheers,
Trevor
I have a usercontrol that presents the majority of a page's content. Within
the ASP.NET application it appears as XXXX.PageControl, where XXXX is the
namespace of my project. There will only ever be one and onely one of these
controls per page. I want to identify the control and set a particular
property depending upon what the current page is.
I want to find this control generically, so I wrote the following code:
for each ctl as control in me.controls
if ctl.GetType is GetType(PageControl) Then
....
exit for
end if
next
But this is never true. If I examine what is returned by
ctl.GetType.ToString, I see "ASP.PageControl_ascx".
Any advice on how to get this comparison working would be appreciated!
Cheers,
Trevor