J
Johan Nordberg
I have made a custom template control which basically loads a web user
control and replaces some PlaceHolders with content that I specify in
the template control tag, like this:
<J2:Host runat="server" id="TemplateHost"
TemplateUrl="Templates/PageTemplate.ascx">
<J2:Content Runat="server" ID="Header" AttachTo="Header" Text="My
text"/>
<J2:Content Runat="server" ID="Content" AttachTo="Content">
This is my content
</J2:Content>
</J2:Host>
This works excellent for just content, but I need to have form field
in my content block as well. The problem is that when I post a form,
the Page that contains the Template Control doesn't recognize the form
fields as children of the page. Therefor event handlers for button
doesn't work, view state is not restored and form field are not
initialized with the posted value.
How do I redirect all the posted data from an child control in my
custom control, to the Page that hosts my control. I kind of would
like all events from my control not handled by the control to bubble
up to the page.
Please help with some ideas!
// Johan
control and replaces some PlaceHolders with content that I specify in
the template control tag, like this:
<J2:Host runat="server" id="TemplateHost"
TemplateUrl="Templates/PageTemplate.ascx">
<J2:Content Runat="server" ID="Header" AttachTo="Header" Text="My
text"/>
<J2:Content Runat="server" ID="Content" AttachTo="Content">
This is my content
</J2:Content>
</J2:Host>
This works excellent for just content, but I need to have form field
in my content block as well. The problem is that when I post a form,
the Page that contains the Template Control doesn't recognize the form
fields as children of the page. Therefor event handlers for button
doesn't work, view state is not restored and form field are not
initialized with the posted value.
How do I redirect all the posted data from an child control in my
custom control, to the Page that hosts my control. I kind of would
like all events from my control not handled by the control to bubble
up to the page.
Please help with some ideas!
// Johan