R
Rick Strahl \(MVP\)
Hi all,
I'm working on a control that has to inject some markup into another control
at the end of rendering. I'm trying to use SetRenderMethodDelegate() to make
this happen.
Unfortunately I can't seem to get this to work.
BindingItem.ControlInstance.SetRenderMethodDelegate( new
RenderMethod(BindingItem.RenderBindingErrorMessage) );
This code fires just fine, but the delegated pointed to never fires, when
rendering time comes. Instead the control just renders as usual with stock
rendering.
The above call to SetRenderDelegate is called typically from page processing
code (ie. Page_Load or a specific event), so it shouldn't be too late to
hook up here. BindingItem is local reference passed by parameter, but its
lifetime is page level (Collection item of a Page Control).
Frankly I'm not sure what to check further. The assignment works without
error so the delegate is correct and the signature should be OK. But the
delegate simply is not fired.
Anybody have any idea of why this wouldn't be working?
Along the same lines, can anybody think of another way to inject markup into
another control? I've arrived here mainly because of issues related to <%=
%> tags in the page making it impossible (ok difficult) to use Control.Add
to add controls dynamically (http://west-wind.com/weblog/posts/5758.aspx)
Any ideas appreciated...
+++ Rick ---
--
Rick Strahl
West Wind Technologies
www.west-wind.com
www.west-wind.com/weblog
I'm working on a control that has to inject some markup into another control
at the end of rendering. I'm trying to use SetRenderMethodDelegate() to make
this happen.
Unfortunately I can't seem to get this to work.
BindingItem.ControlInstance.SetRenderMethodDelegate( new
RenderMethod(BindingItem.RenderBindingErrorMessage) );
This code fires just fine, but the delegated pointed to never fires, when
rendering time comes. Instead the control just renders as usual with stock
rendering.
The above call to SetRenderDelegate is called typically from page processing
code (ie. Page_Load or a specific event), so it shouldn't be too late to
hook up here. BindingItem is local reference passed by parameter, but its
lifetime is page level (Collection item of a Page Control).
Frankly I'm not sure what to check further. The assignment works without
error so the delegate is correct and the signature should be OK. But the
delegate simply is not fired.
Anybody have any idea of why this wouldn't be working?
Along the same lines, can anybody think of another way to inject markup into
another control? I've arrived here mainly because of issues related to <%=
%> tags in the page making it impossible (ok difficult) to use Control.Add
to add controls dynamically (http://west-wind.com/weblog/posts/5758.aspx)
Any ideas appreciated...
+++ Rick ---
--
Rick Strahl
West Wind Technologies
www.west-wind.com
www.west-wind.com/weblog