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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top