1

I have a user control that i have registered in the web.config and i'm using in another user control.

the structure looks like this

  • Base layout
    • home sublayout
      • feature user control 1
      • feature user control 2

when i use the user control as a user control

<ns:feature id="x" runat="server" visible = true/>

the code behind gets hit, but the mark up is never embedded on the page.

if i use it as a sublayout however

<sc:Sublayout ID="x" runat="server" path="/sublayouts/feature.ascx"/>

this renders perfectly fine and i get all the markup.

am i missing some configuration setting? I could use them all as sublayouts, but i'm just curious why it is not working. This is the first time i'm setting up sitecore myself, previously i'v always worked on existing projects.

*update I registered the user control directly on the home sublayout's ascx file and that fixed it. Just realized any user control i use that has been registered in the web.config pointing to the project's own assembly isint working.

4

0 回答 0