J
John Wallace
Hi,
I have a user control which I want to display only to certain users.
How can I "cancel" the rendering of this user control to the page?
i.e.
- Page_Load fires for control - decide if user should see control and
set a flag.
- Based on flag, prevent the user control from outputting ANYTHING to
the page (as early as possible in the event lifecycle, to minimise
unecessary processing)
I want to do this inside the control - as opposed to setting the
usercontrol's "visible" property on the page.
I thought I could override OnPreRender or CreateChildControls (and
call the base function if appropriate) but I can't get this to work!
Thanks,
John
I have a user control which I want to display only to certain users.
How can I "cancel" the rendering of this user control to the page?
i.e.
- Page_Load fires for control - decide if user should see control and
set a flag.
- Based on flag, prevent the user control from outputting ANYTHING to
the page (as early as possible in the event lifecycle, to minimise
unecessary processing)
I want to do this inside the control - as opposed to setting the
usercontrol's "visible" property on the page.
I thought I could override OnPreRender or CreateChildControls (and
call the base function if appropriate) but I can't get this to work!
Thanks,
John