How to correctly identify an usercontrol?

  • Thread starter Thread starter Davids
  • Start date Start date
D

Davids

I'm placing a user control (from file) into an aspx file using @Register and

<MyControls:ListBlogEntries ID="ListBlogEntries" Runat="Server"/>

that particular control is as simple as:

<asp:DataList ID="ListBlogEntries" Runat="server">
<ItemTemplate>
...
</ItemTemplate>
</asp:DataList>


The problem is that I cannot use Page.FindControls to grab it in my
codebehind and if I iterate all page controls there is none with id
"ListBlogEntries"... now how can that be?
 
Davids said:
I'm placing a user control (from file) into an aspx file using @Register
and

<MyControls:ListBlogEntries ID="ListBlogEntries" Runat="Server"/>

that particular control is as simple as:

<asp:DataList ID="ListBlogEntries" Runat="server">
<ItemTemplate>
...
</ItemTemplate>
</asp:DataList>


The problem is that I cannot use Page.FindControls to grab it in my
codebehind and if I iterate all page controls there is none with id
"ListBlogEntries"... now how can that be?

If this is true, it's because of things you haven't told us. For instance,
you haven't said whether the user control the only thing on the page? Try
putting it on a page by itself and see if you can find it.

John Saunders
 
Back
Top