Hi,
I am writing a "print control" routine which expects the id of a
control and will then make every element but the one that is supposed
to be printed invisible (only by using "display: none" style;
Visible=false causes a lot of collateral damage in my scenario).
I thought if I put this into "OnPreRender" I will catch all controls
in the state they will have in the page render method, but if there
are e.g. databound controls that are being setup in the
control_prerender method (for good reason, actually) then the
"display: none" style information may be overwritten by that method
since the page OnPreRender executes before the control's PreRender.
Is there a good time to manipulate the control tree knowing that the
alterations being made are the last ones before rendering, or a
different approach to my aim?
TIA for any hints!
Regards
DC
DC - 31 Jan 2008 11:42 GMT
> Hi,
>
[quoted text clipped - 17 lines]
> Regards
> DC
You can hook to a number of events to accomplish this, one possiblity
is:
protected override void OnInit(EventArgs e)
{
Page.PreRenderComplete += new EventHandler(Page_PreRenderComplete);
}
void Page_PreRenderComplete(object sender, EventArgs e)
{
// do the style thing
}
Cheers
DC
DC - 31 Jan 2008 13:24 GMT
> > Hi,
>
[quoted text clipped - 36 lines]
>
> - Zitierten Text anzeigen -
Thank you! Just what I was looking for.
Regards
DC