0

I working on an asp.net app. I'm have a user control inside a server control, say:

<sc:MyServerControl ID=...>
     <uc:MyUserControl>

     </uc:MyUserControl> 
</sc:MyServerControl>

But it seems that when I use the user control inside the server control, user control doesn't get loaded. I tried putting a break point at the beginning of the Page_Load method but it doesn't stop there.

tks

Brian Mains
  • 50,520
  • 35
  • 148
  • 257
DJPB
  • 5,429
  • 8
  • 30
  • 44

1 Answers1

-1

For this to work you must make changes to the code of the server control. It should have a property of type UserControl and expect this property to be set as an inner property (as opposed to an attribute, like ID="..."). For this to work you should add attributes to the server control class that instruct the ASP.NET parser how to handle inner properties.

For more details, please refer to this article:

The ParseChildren, PersistChildren and PersistenceMode.InnerProperty

Michiel van Oosterhout
  • 22,839
  • 15
  • 90
  • 132